Closed patrick-rotsaert closed 3 years ago
Hi @patrick-rotsaert. I've had a go at this, and have a PR which hopefully does what you're after.
Would you be able to give this branch a try, and see if it meets your requirements?
It has broken one of the other unit tests though, so I'll need to figure that out before merging this.
Anyway let me know how you get on, and thanks for your interest!
Hi @chrusty, your change does exactly what I needed. Thanks a lot.
This is merged and included in the latest release (https://github.com/chrusty/protoc-gen-jsonschema/releases/tag/0.9.9)
Hey @patrick-rotsaert, had to re-open this one as it has caused some issues elsewhere. I'm planning on putting the new oneOf
interpretation behind a feature flag. You'll be able to use it just fine, the only difference is you'll need to use an extra command-line option when generating your oneOf schemas. Probably a number of people (including myself) had made assumptions around how oneOf was interpreted.
@patrick-rotsaert see the new release: https://github.com/chrusty/protoc-gen-jsonschema/releases/tag/0.9.10
When converting the following proto file:
then the resulting json schema is:
This would allow a
Foo
instance to contain both thebar
andbaz
attributes, which kind of defeats the purpose of theoneof
.Would it be possible to generate a schema like this instead?