Releases: chrusty/protoc-gen-jsonschema
Initial support for protoc-gen-validate options, google.protobuf.ListValue, excluded comments
This release contains 3 new features:
- Introducing initial support for validation options from protoc-gen-validate. This will be built out over time
- Properly handling google.protobuf.ListValue, thanks @oliver
- Baisc support for excluding certain comments from generated schemas
Adopting a proper package name for the options proto
This release includes a proper package name for the options proto.
Thanks to @betamike for pointing this one out.
Convert google Int64Value to strings
This release introduces specific support for Google Int64 values (as strings).
Thanks @ianvdhSBM for your contribution!
Support for stripping ENUM prefixes
This release introduces a new option, to strip prefixes from ENUM values. Usually ENUM values are given a prefix (this avoids namespace clashes, and allows you to understand exactly where they came from) - but that does lead to ugly strings sometimes, so we now have an option to disable that behaviour.
Thanks @zbiljic for your contribution!
Fixing a bigint-as-string bug
This release addresses an issue which was raised recently, in which bigints were still rendered as strings even when disallow-bigints-as-strings was selected (when combined with null values).
Thanks for raising this, @dbedari-indeed!
Field constraint validation
This release brings some new field options to validate constraints:
- minimum length
- maximum length
- pattern (regex)
Thanks @faroceann for your contribution!
Titles, descriptions, and default proto package
A couple of slightly different behaviours here, by request:
- Titles will now be added to JSONSchemas. These are either taken from the first comment (where there are more than one), or automatically generated from the proto message name (thanks @mrozycki-tink)
- Newline characters are now stripped from description fields (thanks @jcchavezs)
- Proto3
package
is no longer required, and will now default to "package" instead (thanks @amarkevich)
Control over ENUM values
This version introduces a new converter flag / option which controls the types of values generated for ENUMs. The default behaviour is still to generate strings AND numbers, but the new flag / option limits this to the string values only.
See the README for details and examples:
- https://github.com/chrusty/protoc-gen-jsonschema#configuration-parameters
- https://github.com/chrusty/protoc-gen-jsonschema#enum-options
Thanks @mrozycki-tink for your contribution!
Claiming support for proto3 "optional" fields
Recent versions of the protoc libraries require a specific support flag to be set in order to work with proto3 "optional" fields. This release sets that flag, but currently doesn't treat these fields any differently. Future releases may introduce new logic around these fields, but for now this at least allows people to continue to generate schemas.
JSON fieldnames for required fields
Currently, the required fields list will always contain only the protobuf names of fields, even if the json_fieldnames option is used.
In this release the behavior is changed to instead use JSON names if the json_fieldnames option is used, and proto names in all the other cases.
Thank you @mrozycki-tink for this contribution!