chrusty / protoc-gen-jsonschema

Protobuf to JSON-Schema compiler
Apache License 2.0
496 stars 101 forks source link

Support nullable arrays when using `all_fields_required` #185

Open ikstewa opened 6 months ago

ikstewa commented 6 months ago

After https://github.com/chrusty/protoc-gen-jsonschema/commit/11e14e6de6c0d7f7f6d45b173735546b77f548ea the all_fields_required flag respects the proto3 optional keyword.

According to the proto3 JSON Mapping a null json array is treated the same as an empty json array. I think it would make sense to follow the pattern with the proto3 optionl and also not mark repeated fields as required when mapping to json schema.