Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for anyof_ref #72

Closed
wants to merge 5 commits into from
Closed

Conversation

gmlewis
Copy link
Contributor

@gmlewis gmlewis commented Feb 2, 2023

Fixes: #71.

Signed-off-by: Glenn Lewis <[email protected]>
Signed-off-by: Glenn Lewis <[email protected]>
Signed-off-by: Glenn Lewis <[email protected]>
Copy link
Contributor

@samlown samlown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. I suspect this might have conflicts with #69 (ipAddress could be ip_address to be more consistent with the other examples)

Signed-off-by: Glenn Lewis <[email protected]>
@gmlewis
Copy link
Contributor Author

gmlewis commented Jun 27, 2023

Looks fine. I suspect this might have conflicts with #69 (ipAddress could be ip_address to be more consistent with the other examples)

These two PRs should actually merge nicely with each other. I first implemented the feature in #69 and later added this feature, but both work together in my repo. I'll help with the merging when it comes time and resolve any conflicts.

Sorry for the delay. I addressed the review feedback. PTAL.

Signed-off-by: Glenn Lewis <[email protected]>
@@ -37,6 +37,8 @@ type TestUser struct {
BirthDate time.Time `json:"birth_date,omitempty" jsonschema:"oneof_required=date"`
YearOfBirth string `json:"year_of_birth,omitempty" jsonschema:"oneof_required=year"`
Metadata interface{} `json:"metadata,omitempty" jsonschema:"oneof_type=string;array"`
IPAddress2 interface{} `json:"ip_address2,omitempty" jsonschema:"anyof_ref=#/$defs/ipv4;#/$defs/ipv6"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think these are important enough to stick in the README. I think the best way forward here is with some custom tests inside the refect_test.go file.

@samlown
Copy link
Contributor

samlown commented Sep 6, 2023

This is now fixed in #92. Thanks!

@samlown samlown closed this Sep 6, 2023
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.

Feature request: support anyof_ref
2 participants