encoding/jsonschema: recognize closed structs in Generate
This uses the new `Value.IsClosed` API to determine whether to
specify `additionalProperties`.
Looking forward to Kubernetes structural schemas, we make
provision for avoiding `additionalProperties: false` by
adding a new configuration option `ExplicitOpen`.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Ic75268d7cee72b674524e01fb1dc159474694cad
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1224375
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>