You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 20, 2024. It is now read-only.
* This is a way to force consts for enum
* New enum options
* ENUM const logic
* Tests
* Forcing version draft-06
* README update
* Regenerated jsonschemas too
* Switching title for description
* Dynamically changing schema version when const is used
* Updated unit tests
Co-authored-by: Chrusty <>
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,12 @@ Custom Proto Options
90
90
91
91
If you don't want to use the configuration parameters (admittedly quite a nasty cli syntax) then some of the generator behaviour can be controlled using custom proto options. These are defined in [options.proto](options.proto), and your protoc command will need to include this file. See the [sample protos](internal/converter/testdata/proto) and generator commands in the [Makefile](Makefile).
92
92
93
+
### Enum Options
94
+
95
+
These apply to specifically marked enums, giving you more finely-grained control than with the CLI flags.
96
+
97
+
-[enums_as_constants](internal/converter/testdata/proto/ImportedEnum.proto): Encode ENUMs (and their annotations) as CONST
98
+
93
99
### Field Options
94
100
95
101
These apply to specifically marked fields, giving you more finely-grained control than with the CLI flags.
@@ -112,6 +118,7 @@ These options apply to a specific proto message.
112
118
-[all_fields_required](internal/converter/testdata/proto/OptionRequiredMessage.proto): Mark all fields in a specific message as "required"
113
119
-[allow_null_values](internal/converter/testdata/proto/OptionAllowNullValues.proto): Additionally allow null values for all fields in a message
114
120
-[disallow_additional_properties](internal/converter/testdata/proto/OptionDisallowAdditionalProperties.proto): Only accept the specific properties, no extras
121
+
-[enums_as_constants](internal/converter/testdata/proto/OptionEnumsAsConstants.proto): Encode ENUMs (and their annotations) as CONST
0 commit comments