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 oneof_ref #69

Merged
merged 5 commits into from
Sep 6, 2023
Merged

Add support for oneof_ref #69

merged 5 commits into from
Sep 6, 2023

Conversation

gmlewis
Copy link
Contributor

@gmlewis gmlewis commented Jan 13, 2023

Fixes: #68.

Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
@andreafalzetti
Copy link

It'd be great to keep this pkg alive, I am happy to help review PRs cc @samlown

@samlown
Copy link
Contributor

samlown commented Jun 12, 2023

It'd be great to keep this pkg alive, I am happy to help review PRs cc @samlown

It is alive! I've just not had enough time of late 😮‍💨 I'll crank through a few PRs now.

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 good! Thanks! I now handle these types of situations with a JSONSchemaExtend method on the model, but I can see how this is more convenient.

examples_test.go Outdated
Comment on lines 19 to 20
IPAddress interface{} `json:"ipAddress,omitempty" jsonschema:"oneof_ref=#/$defs/ipv4;#/$defs/ipv6"`
IPAddresses []interface{} `json:"ipAddresses,omitempty" jsonschema:"oneof_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 appreciate these are only samples, but I'd still stick to the common pattern of ip_address.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delay. Done. PTAL.

@samlown samlown mentioned this pull request Jun 12, 2023
gmlewis added 2 commits June 26, 2023 20:06
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
@samlown samlown merged commit 88a348b into invopop:main 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 oneof_ref
3 participants