Skip to content

Conversation

@boekkooi-impossiblecloud
Copy link

@boekkooi-impossiblecloud boekkooi-impossiblecloud commented Jul 11, 2025

Good day,

While I was using the protoc-gen-jsonschema and it's generated schemas I noticed that oneOf validation was not happening for the on the JSON schema level.

This PR implements the protobuf oneOf functionality and (buf.validate.message).oneof using the JSON Schema allOf and anyOf by using not in combination with required to exclude all other fields except for the one needed.

Thanks for reviewing this PR! Please let me know what you think and have a great day!

@CLAassistant
Copy link

CLAassistant commented Jul 11, 2025

CLA assistant check
All committers have signed the CLA.

Ran `make lint` and resolved warnings/errors.
@boekkooi-impossiblecloud
Copy link
Author

boekkooi-impossiblecloud commented Jul 31, 2025

Due to the upgrade to 1.14 in #98 and the addition of buf.validate.message.oneof i have rebased the PR and added the commits 331fc79, 10e9606 and 2972675.

@boekkooi-impossiblecloud
Copy link
Author

Hey @pkwarren

Sorry to bug but is there any chance you could maybe have a look at this PR and let me know if this is an addition that would be welcome?

Thanks in advance!

@hudlow
Copy link

hudlow commented Sep 7, 2025

Hey @boekkooi-impossiblecloud, thanks for the PR! I have some questions over here: #109 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants