Skip to content

Commit

Permalink
encoding/jsonschema: support legacy id field
Browse files Browse the repository at this point in the history
In older schema versions, the "id" field was used instead
of "$id". Support that by predicating the logic on the schema
version.

Signed-off-by: Roger Peppe <[email protected]>
Change-Id: I2b4c2410750db227c1a97aa1b71832d5ec65a726
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199306
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
  • Loading branch information
rogpeppe committed Aug 13, 2024
1 parent 6c26e3c commit 709741d
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 73 deletions.
1 change: 0 additions & 1 deletion cmd/cue/cmd/testdata/script/def_jsonschema.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import "strings"
#Person: {
// Person
@jsonschema(schema="http://json-schema.org/draft-07/schema#")
@jsonschema(id="https://example.com/person.schema.json")

// The person's first name.
firstName?: string
Expand Down
Loading

0 comments on commit 709741d

Please sign in to comment.