encoding/openapi: make OrderedMap type opaque
The OrderedMap needs to be a pointer, which may be
a bit unintuitive it being a slice. Change it to as struct.
Info is left as a non-pointer to indicate the non-optional
nature of it. The user of pointers is enforced by making
MarshalJSON only work for pointer types.
Change-Id: I8481dd8974825928815bfef3acd1eb5fc0274029
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2460
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/encoding/openapi/openapi_test.go b/encoding/openapi/openapi_test.go
index 7bb1b0c..d5eb721 100644
--- a/encoding/openapi/openapi_test.go
+++ b/encoding/openapi/openapi_test.go
@@ -31,7 +31,7 @@
var update *bool = flag.Bool("update", false, "update the test output")
func TestParseDefinitions(t *testing.T) {
- info := OrderedMap{KeyValue{"title", "test"}, KeyValue{"version", "v1"}}
+ info := OrderedMap{kvs: []KeyValue{{"title", "test"}, {"version", "v1"}}}
defaultConfig := &Config{}
resolveRefs := &Config{Info: info, ExpandReferences: true}