encoding/openapi: update API
This updates the encoding/openapi package to avoid using the outdated
`*cue.Instance` API and use `cue.Value` instead.
To avoid backward incompatibility, the entry points are changed to use
`cue.InstanceOrValue` instead of `*cue.Instance` and a new `Config.NameFunc`
is introduced to replace `Config.ReferenceFunc`.
Also fix an issue that `Config.Info` is documented as allowing any type
that marshals to JSON, but that didn't work (it only allowed `*ast.StructLit`).
Issue #1806.
Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: Ib446a99ebe7176d427f9bb344a51d4ee6d4e1af5
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/542287
Reviewed-by: Marcel van Lohuizen <mpvl@gmail.com>
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>