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

oneof_type prevents interpretation of other keyword tags #113

Open
Rosswell opened this issue Oct 26, 2023 · 0 comments
Open

oneof_type prevents interpretation of other keyword tags #113

Rosswell opened this issue Oct 26, 2023 · 0 comments

Comments

@Rosswell
Copy link

Rosswell commented Oct 26, 2023

because oneof_type doesnt write to the Type property of a Schema object, the switch statement in structKeywordsFromTags doesn't interpret any other tags. so a set of tags like

Field1 *string `jsonschema:"oneof_type=string;null,enum=VAL1,enum=VAL2"`

will not parse the enum tags, because oneof_type sets the OneOf property instead of the Type property

in this particular example, its arguable that the enum values should not be parsed, but imo if null was an enum value as well i would say that they should be

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

No branches or pull requests

1 participant