You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default keyword specifies a default value. This value is not used to fill in missing values during the validation process.
That says to me that the bug here is not that we are generating optional fields that include default values, but that we are including default values in the schema at all. I think that we should probably only generate pure schema values (no regular fields, no default values) from JSON Schema, at least for now. In the future, we can have the option to generate a template value that does include regular fields and defaults, but the current mixed approach seems somewhat wrong to me.
I'll retitle this issue accordingly.
rogpeppe
changed the title
encoding/jsonschema: default values are incorrectly encoded as optional fields
encoding/jsonschema: default values should be ignored when generating schemas
Oct 1, 2024
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest release?
n/a - tested with tip.
What did you do?
What did you expect to see?
Passing test.
What did you see instead?
The text was updated successfully, but these errors were encountered: