encoding/jsonschema: better "type excluded" logic
Currently, the error "constraint not allowed because type xxx is
excluded" is produced when there is a constraint for a given kind and
the type is known to be disallowed. However, types are not exclusive in
this way in JSONSchema.
Instead, produce an error only when _all_ types are known to be excluded
which, although technically still not an error, is much less likely to
result in a real-world schema being rejected.
Fixes #393.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I45b4a7fa540ba537f2e2dbfe973782474be280d5
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1199308
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>