encoding/jsonschema: allow impossible subschemas
Some real-world schemas contain self-contradictory elements, despite
being useful in practice. We change `encoding/jsonschema` so that it's
not necessarily an error to have a self-contradictory schema as long as
the top level schema itself is not self-contradictory.
This allows us to generate CUE for more real-world schemas, such as this
one:
https://github.com/SchemaStore/schemastore/blob/c084075dbfa7eb7da2c4c81456d04543b7be5744/src/schemas/json/stylelintrc.json#L173
We might add functionality to enable stricter vetting of such schemas in
the future, but for now, schema linting is not what we're aiming for.
Fixes #3455
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I60f5b56b7afd59d9e42ca93906f6f335b4500a39
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1201396
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>