-
Notifications
You must be signed in to change notification settings - Fork 496
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
Misuse of jsonschema in specs. #884
Comments
This was referenced Nov 13, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, we use jsonschema in Spec this way:
We want in our yaml file must contain
field1
and may or may not containfield2
, if containfield2
it must be one of ["1", "2"].But in practice, I find write jsonschema in this way not work as expected.
The right way should be like:
For
fileld1
, the reason is simple,field1
is required, and default value of *stirng nil is not acceptable (default value of string "" is acceptable in previous case).For
field2
we need setomitempty
injson
part too, only injsonschema
part is not good enough.I think we should consider to update these influenced Specs... Any idea here?
The text was updated successfully, but these errors were encountered: