-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
encoding/jsonschema: do not generate defaults
The `default` keyword in JSON Schema should be an annotation, not a constraint, and in general schemas in CUE should be pure, so having the defaults in there seems wrong, especially as: - it precludes people from adding their own defaults - defaults don't work when they're inside `matchN` calls - defaults will not work as expected inside optional or required fields, which are the only kind of fields that encoding/jsonschema produces. In the future, we might wish to provide template-like values that do include defaults (that's issue #3473), but for now, this keeps things simple and avoids issues with collisions with defaults in user code. So we remove support for `default`, and also remove the unused code for `examples`: we can add it back later in the same or another form as desired. Fixes #3472 Signed-off-by: Roger Peppe <rogpeppe@gmail.com> Change-Id: I544734d3361c7b2eff410dae8f27d831ec8c0e97 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1207146 TryBot-Result: CUEcueckoo <cueckoo@cuelang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
- Loading branch information
Showing
9 changed files
with
12 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters