Skip to content

Commit

Permalink
View enums should be nested inside the resource.
Browse files Browse the repository at this point in the history
  • Loading branch information
rofrankel committed Jul 24, 2024
1 parent f4c7d80 commit 7dbc3ad
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions aep/general/0157/aep.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ enums are useful for situations where an API only wants to expose a small
number of permutations to the user:

- The enum **should** be specified as a `view` field on the request message.
- The enum **should** be named something ending in `-View`
- The enum **should** at minimum have values named `BASIC` and `FULL` (although
it **may** have values other than these).
- The `UNSPECIFIED` value **must** be valid (not an error), and the API
**must** document what the unspecified value will do.
- For List methods, the effective default value **should** be `BASIC`.
Expand Down Expand Up @@ -89,9 +86,11 @@ enum BookView {
}
```

- The enum **should** be defined at the top level of the proto file (as it is
likely to be needed in multiple requests, e.g. both `Get` and `List`). See
[enumerations](./enumerations) for more guidance on top-level enumerations.
- The enum **should** be defined within the resource; methods can reference it
as e.g. `Book.View`.
- The enum **should** be named something ending in `-View`
- The enum **should** at minimum have values named `BASIC` and `FULL` (although
it **may** have values other than these).

{% tab oas %}

Expand Down

0 comments on commit 7dbc3ad

Please sign in to comment.