-
Notifications
You must be signed in to change notification settings - Fork 97
Add custom option (similar to hidden) that lets user specify specific required fields #76
Comments
Hey @clementdoordash, thanks for raising this. OK, I guess this means that you've already tried the new hidden / ignore option? Implementing this "required" logic using another proto option shouldn't be too much of a hassle. I'll take a look and hopefully get something implemented for you to try soon. |
Have a look at the new release https://github.com/chrusty/protoc-gen-jsonschema/releases/tag/1.0.5 Hopefully this does what you need! |
Yes! That's exactly it. Thank you :). |
I'm glad this is working as expected. Like I said, easy enough to implement. I would like to point out that I have done this in quite a messy way, and have some work in the pipeline to tidy up how these custom options are presented and interpreted. I've also applied for an official options number in the protobuf repo. It means that in a future release you will have to use the protoc-gen-jsonschema options.proto in a slightly different way, but it shouldn't be a huge change for you. Just a heads up. |
OK, the new behaviour is live in https://github.com/chrusty/protoc-gen-jsonschema/releases/tag/1.1.0 |
Currently required is all or nothing for proto3 syntax. Would be really helpful to have a custom option that let's us specify if a single attirbute is required in json.
The text was updated successfully, but these errors were encountered: