Support maxProperties=1 constraints by marking them as oneof for protobuf generation - #317
Merged
Merged
Conversation
…ts by marking them as `oneof` for protobuf generation Signed-off-by: xil <fridalu66@gmail.com>
lucy66hw
force-pushed
the
min/maxProperties1
branch
from
December 1, 2025 04:20
b8b53eb to
5f299eb
Compare
oneof for protobuf generation
lucy66hw
marked this pull request as ready for review
December 1, 2025 04:42
lucy66hw
requested review from
amberzsy,
karenyrx and
philiplhchan
as code owners
December 1, 2025 04:42
Collaborator
|
Pasting convo from slack for reference: This is my understanding of the expected behavior of min/max=1 (let me know if i got this right)
This PR is to implement case 1. the case 2 had already implemented previously. it already changed the schema to not having additionalProperty. for case3, it would be the corner case that we can't handle it properly. Summary:
|
Signed-off-by: xil <fridalu66@gmail.com>
oneof for protobuf generationoneof for protobuf generation
Collaborator
|
Removing minProperties=1 in proto makes sense since there is no way to represent this in protos, and should be validated in server-side code instead. |
karenyrx
approved these changes
Dec 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Support maxProperties=1 constraints by marking them as
oneoffor protobuf generationTest
lucy66hw#63
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.