Skip to content

Commit 0a97533

Browse files
committed
encoding/openapi: correct typo
Change-Id: I864b86c333069e7e1cacf02ed9d140e13c29ad2a Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2461 Reviewed-by: Marcel van Lohuizen <[email protected]>
1 parent c89f5a6 commit 0a97533

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

encoding/openapi/build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func schemas(g *Generator, inst *cue.Instance) (schemas *OrderedMap, err error)
7676

7777
c := buildContext{
7878
inst: inst,
79-
refPrefix: "components/schema",
79+
refPrefix: "components/schemas",
8080
expandRefs: g.ExpandReferences,
8181
nameFunc: g.ReferenceFunc,
8282
descFunc: g.DescriptionFunc,

encoding/openapi/openapi.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (g *Generator) All(inst *cue.Instance) (*OrderedMap, error) {
8282
}
8383

8484
schemas := &OrderedMap{}
85-
schemas.Set("schema", all)
85+
schemas.Set("schemas", all)
8686

8787
top := &OrderedMap{}
8888
top.Set("openapi", "3.0.0")

encoding/openapi/testdata/array.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.0",
33
"info": {},
44
"components": {
5-
"schema": {
5+
"schemas": {
66
"Arrays": {
77
"type": "object",
88
"properties": {

encoding/openapi/testdata/oneof-funcs.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"version": "v1"
66
},
77
"components": {
8-
"schema": {
8+
"schemas": {
99
"MYSTRING": {
1010
"description": "Randomly picked description from a set of size one.",
1111
"oneOf": [
@@ -51,17 +51,17 @@
5151
],
5252
"properties": {
5353
"include": {
54-
"$ref": "#/components/schema/MYSTRING"
54+
"$ref": "#/components/schemas/MYSTRING"
5555
},
5656
"exclude": {
5757
"description": "Randomly picked description from a set of size one.",
5858
"type": "array",
5959
"items": {
60-
"$ref": "#/components/schema/MYSTRING"
60+
"$ref": "#/components/schemas/MYSTRING"
6161
}
6262
},
6363
"count": {
64-
"$ref": "#/components/schema/MYINT"
64+
"$ref": "#/components/schemas/MYINT"
6565
}
6666
}
6767
}

encoding/openapi/testdata/oneof.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.0",
33
"info": {},
44
"components": {
5-
"schema": {
5+
"schemas": {
66
"MyString": {
77
"oneOf": [
88
{
@@ -43,16 +43,16 @@
4343
],
4444
"properties": {
4545
"include": {
46-
"$ref": "#/components/schema/MyString"
46+
"$ref": "#/components/schemas/MyString"
4747
},
4848
"exclude": {
4949
"type": "array",
5050
"items": {
51-
"$ref": "#/components/schema/MyString"
51+
"$ref": "#/components/schemas/MyString"
5252
}
5353
},
5454
"count": {
55-
"$ref": "#/components/schema/MyInt"
55+
"$ref": "#/components/schemas/MyInt"
5656
}
5757
}
5858
}

encoding/openapi/testdata/openapi-norefs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"version": "v1"
66
},
77
"components": {
8-
"schema": {
8+
"schemas": {
99
"MyMessage": {
1010
"description": "MyMessage is my message.",
1111
"allOf": [

encoding/openapi/testdata/openapi.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.0",
33
"info": {},
44
"components": {
5-
"schema": {
5+
"schemas": {
66
"MyMessage": {
77
"description": "MyMessage is my message.",
88
"allOf": [
@@ -14,13 +14,13 @@
1414
],
1515
"properties": {
1616
"port": {
17-
"$ref": "#/components/schema/Port",
17+
"$ref": "#/components/schemas/Port",
1818
"type": "object"
1919
},
2020
"foo": {
2121
"allOf": [
2222
{
23-
"$ref": "#/components/schema/Int32"
23+
"$ref": "#/components/schemas/Int32"
2424
},
2525
{
2626
"type": "number",
@@ -261,7 +261,7 @@
261261
{
262262
"oneOf": [
263263
{
264-
"$ref": "#/components/schema/Port"
264+
"$ref": "#/components/schemas/Port"
265265
},
266266
{
267267
"type": "object",

encoding/openapi/testdata/simple-filter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"version": "v1"
66
},
77
"components": {
8-
"schema": {
8+
"schemas": {
99
"MyStruct": {
1010
"type": "object",
1111
"required": [

encoding/openapi/testdata/simple.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"version": "v1"
66
},
77
"components": {
8-
"schema": {
8+
"schemas": {
99
"MyStruct": {
1010
"type": "object",
1111
"required": [

0 commit comments

Comments
 (0)