Conversation
lukesneeringer
commented
May 11, 2021
| ## Guidance | ||
|
|
||
| For concepts where a standardized code exists and is in common use, fields | ||
| representing these concepts **should** use the standardized code for both input |
Contributor
Author
There was a problem hiding this comment.
- @Alfus The important part here is that the string itself is the immutable, canonical code, and is used on the wire format. You do not need to create a separate enum, and if you do, then you fall out of synchronization quickly.
- @hudlow What this does bring to mind is that we validate that enums are lower snake strings. But this guidance correctly says, do not bastardize canonical codes into lower snake.
- @lukesneeringer It sounds like the IBM linter needs an exception here, allowing industry standard formats.
Contributor
Author
There was a problem hiding this comment.
@hudlow Perhaps a specific note about not bastardizing strings into a company's string enum format.
aip/general/0143/aip.md
Outdated
|
|
||
| - Fields representing standardized concepts **must** use the appropriate data | ||
| type for the standard code (usually `string`). | ||
| - Fields representing standardized concepts **should not** use enums, even if |
Contributor
Author
There was a problem hiding this comment.
Maybe distinguish the OpenAPI "choices" concept here.
| case-insensitive unless this would introduce ambiguity (for example, accept | ||
| both `en-gb` and `en-GB`). When providing values to users, APIs **should** | ||
| use the canonical case (in the example above, `en-GB`). | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Maybe add a quick section about defaults, saying that defaults are permissible, and the sentinel value must be empty.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.