protoyaml-go icon indicating copy to clipboard operation
protoyaml-go copied to clipboard

Allow omitting the standard enum prefix

Open Alfus opened this issue 1 year ago • 2 comments

When StrictEnums is false, the following is now allowed:

  - oneof_enum_value: VALUE_1

The following is always allowed:

  - oneof_enum_value: PROTO2_TEST_ENUM_VALUE_1

Note that this does not impact 'encoding', which always produces protojson-compatible output.

Alfus avatar Apr 24 '25 20:04 Alfus

Every change also requires a change to the json schema plugin. Protoyaml input has never been (and never needs to be) valid protojson. Only the output is normalized to be compatible.

Alfus avatar Apr 25 '25 14:04 Alfus

Honestly, because there are no backwards compatibility issues, there should be no option. This change only changes what used to be an error in to an intuitive non-error case. If any option should be supported it is the option to specify which one you want the jsonschema plugin to suggest, which is external to this library.

Alfus avatar Apr 25 '25 14:04 Alfus