encoding/jsonschema: minor improvements to Generate
This generates slightly more idiomatic JSON Schema
by avoiding an `items` keyword when it's not needed
and by using `type: "null"` rather than `const: "null"`.
The latter in particular will make it easier to fold
multiple `type` constraints in `anyOf` to be folded
into a single multiple-type constraint.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I201acd032b60e928632e090c10a5d80fe6c5edf3
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1224282
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>