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
encoding/jsonschema: support single schema not at root
Currently it's possible to ask encoding/jsonschema to
decode a set of named schemas not at the root
of the data document passed in by using `Config.Root`.
However, it's not possible to ask for a single schema not
at the root. Since that schema might refer to
other schemas within the same JSON data,
it's not quite as simple as extracting the sub-schema
and then passing it to encoding/jsonschema.
Support this mode by adding `Config.SingleRoot` to
enable it.
This will help us to translate Kubernetes CRD files.
Also in passing make `jsonschema.Config.Root` work with
integer indexes, as the schema in CRD files is inside an
array. There's still an ambiguity but it seems much less likely
that there will be named roots inside integerlike string fields
than inside arrays.
For #2691
Signed-off-by: Roger Peppe <[email protected]>
Change-Id: I0870632d7261f37a460a161b722af64539534314
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1209501
TryBot-Result: CUEcueckoo <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
0 commit comments