encoding/jsonschema: recognize different forms of "const"
There are several different forms of CUE that might correspond to
a JSON Schema `const` keyword's value.
This updates the Generate logic to recognize several of them,
including notably the form used by Extract to represent
constant structs: `close({a!: int})`.
This relies on the newly added `Patterns` option to determine
that a struct is actually closed.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I612fceabda8aa73319c0fa64b885cb80ce611a39
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1224432
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>