-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example options for most types (#239)
This PR adds an example field for many types. Examples are no-op constraints that allow you to declare what an example value for each field may look like. These values SHOULD match the other constraints. It's planned that a `buf lint` rule will check these values to see if they do, in fact, validate given the other constraints on the field. Here are the types that this was added to: - float - double - int32 - int64 - uint32 - uint64 - sint32 - sint64 - fixed32 - fixed64 - sfixed32 - sfixed64 - bool - string - bytes - enum - duration - timestamp All fields are `repeatable`, to allow for multiple examples. I'm unsure if there is a better way to have a no-op constraint other than `expression: "true"`, so please let me know if I can just exclude `expression` altogether or if there is another way to do that. This resolves #237. --------- Co-authored-by: Chris Roche <[email protected]>
- Loading branch information
1 parent
d0a45fa
commit eecae2a
Showing
34 changed files
with
6,052 additions
and
3,998 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.