Skip to content

Commit

Permalink
encoding/openapi: update tests
Browse files Browse the repository at this point in the history
Not sure why the Git CI didn't catch this.

Change-Id: I1869cf3376f5caca52d5ccb68375e5dc03d6a8ea
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6441
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
  • Loading branch information
mpvl committed Jun 18, 2020
1 parent ecfbd72 commit d3c0096
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 82 deletions.
8 changes: 4 additions & 4 deletions encoding/openapi/testdata/builtins.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@
"properties": {
"timestamp1": {
"type": "string",
"format": "dateTime"
"format": "date-time"
},
"timestamp2": {
"type": "string",
"format": "dateTime"
"format": "date-time"
},
"timestamp3": {
"type": "string",
"format": "dateTime"
"format": "date-time"
},
"timestamp4": {
"type": "string",
"format": "dateTime"
"format": "date-time"
},
"date1": {
"type": "string",
Expand Down
15 changes: 5 additions & 10 deletions encoding/openapi/testdata/oneof-funcs.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@
"properties": {
"exact": {
"description": "Randomly picked description from a set of size one.",
"type": "string",
"format": "string"
"type": "string"
}
}
},
Expand All @@ -293,8 +292,7 @@
"properties": {
"regex": {
"description": "Randomly picked description from a set of size one.",
"type": "string",
"format": "string"
"type": "string"
}
}
}
Expand All @@ -308,8 +306,7 @@
"properties": {
"exact": {
"description": "Randomly picked description from a set of size one.",
"type": "string",
"format": "string"
"type": "string"
}
}
},
Expand All @@ -320,8 +317,7 @@
"properties": {
"regex": {
"description": "Randomly picked description from a set of size one.",
"type": "string",
"format": "string"
"type": "string"
}
}
}
Expand Down Expand Up @@ -488,8 +484,7 @@
"properties": {
"shared": {
"description": "Randomly picked description from a set of size one.",
"type": "string",
"format": "string"
"type": "string"
},
"extra": {
"description": "Randomly picked description from a set of size one.",
Expand Down
26 changes: 7 additions & 19 deletions encoding/openapi/testdata/oneof-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,10 @@
"type": "integer"
},
"exact": {
"type": "string",
"format": "string"
"type": "string"
},
"regex": {
"type": "string",
"format": "string"
"type": "string"
}
},
"allOf": [
Expand Down Expand Up @@ -229,12 +227,10 @@
"type": "integer"
},
"exact": {
"type": "string",
"format": "string"
"type": "string"
},
"regex": {
"type": "string",
"format": "string"
"type": "string"
}
},
"allOf": [
Expand Down Expand Up @@ -383,12 +379,10 @@
"type": "integer"
},
"exact": {
"type": "string",
"format": "string"
"type": "string"
},
"regex": {
"type": "string",
"format": "string"
"type": "string"
}
},
"allOf": [
Expand Down Expand Up @@ -463,13 +457,7 @@
"WithMap": {
"type": "object",
"properties": {
"shared": {
"type": "object",
"format": "string",
"additionalProperties": {
"type": "integer"
}
},
"shared": {},
"extra": {
"type": "integer"
}
Expand Down
15 changes: 5 additions & 10 deletions encoding/openapi/testdata/oneof.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,7 @@
],
"properties": {
"exact": {
"type": "string",
"format": "string"
"type": "string"
}
}
},
Expand All @@ -267,8 +266,7 @@
],
"properties": {
"regex": {
"type": "string",
"format": "string"
"type": "string"
}
}
}
Expand All @@ -281,8 +279,7 @@
],
"properties": {
"exact": {
"type": "string",
"format": "string"
"type": "string"
}
}
},
Expand All @@ -292,8 +289,7 @@
],
"properties": {
"regex": {
"type": "string",
"format": "string"
"type": "string"
}
}
}
Expand Down Expand Up @@ -444,8 +440,7 @@
],
"properties": {
"shared": {
"type": "string",
"format": "string"
"type": "string"
},
"extra": {
"type": "integer"
Expand Down
16 changes: 5 additions & 11 deletions encoding/openapi/testdata/openapi-norefs.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@
"type": "number"
},
"a": {
"type": "string",
"format": "string"
"type": "string"
}
},
"oneOf": [
Expand Down Expand Up @@ -118,8 +117,7 @@
"bar": {
"type": "array",
"items": {
"type": "string",
"format": "string"
"type": "string"
}
},
"a": {
Expand All @@ -130,8 +128,7 @@
]
},
"b": {
"type": "string",
"format": "string"
"type": "string"
}
},
"oneOf": [
Expand Down Expand Up @@ -169,12 +166,9 @@
"type": "object",
"properties": {
"a": {
"type": "string",
"format": "string"
"type": "string"
},
"b": {
"format": "string"
}
"b": {}
},
"oneOf": [
{
Expand Down
15 changes: 5 additions & 10 deletions encoding/openapi/testdata/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@
],
"properties": {
"a": {
"type": "string",
"format": "string"
"type": "string"
}
}
}
Expand Down Expand Up @@ -113,8 +112,7 @@
"bar": {
"type": "array",
"items": {
"type": "string",
"format": "string"
"type": "string"
}
}
},
Expand All @@ -139,8 +137,7 @@
],
"properties": {
"b": {
"type": "string",
"format": "string"
"type": "string"
}
}
}
Expand Down Expand Up @@ -168,8 +165,7 @@
"type": "object",
"properties": {
"a": {
"type": "string",
"format": "string"
"type": "string"
}
},
"oneOf": [
Expand All @@ -189,8 +185,7 @@
],
"properties": {
"b": {
"type": "string",
"format": "string"
"type": "string"
}
}
},
Expand Down
6 changes: 2 additions & 4 deletions encoding/openapi/testdata/refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
],
"properties": {
"b": {
"type": "string",
"format": "string"
"type": "string"
}
}
},
Expand Down Expand Up @@ -47,8 +46,7 @@
"type": "object",
"properties": {
"a": {
"type": "string",
"format": "string"
"type": "string"
}
},
"allOf": [
Expand Down
1 change: 0 additions & 1 deletion encoding/openapi/testdata/simple-filter.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
},
"deprecatedField": {
"type": "string",
"format": "string",
"deprecated": true
}
}
Expand Down
1 change: 0 additions & 1 deletion encoding/openapi/testdata/simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
},
"deprecatedField": {
"type": "string",
"format": "string",
"deprecated": true
}
}
Expand Down
19 changes: 7 additions & 12 deletions encoding/openapi/testdata/structural.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"properties": {
"stringValue": {
"description": "Used for values of type STRING, DNS_NAME, EMAIL_ADDRESS, and URI",
"type": "string",
"format": "string"
"type": "string"
},
"int64Value": {
"description": "Used for values of type INT64",
Expand All @@ -38,7 +37,7 @@
"timestampValue": {
"description": "Used for values of type TIMESTAMP",
"type": "string",
"format": "dateTime"
"format": "date-time"
},
"durationValue": {
"description": "Used for values of type DURATION",
Expand All @@ -55,8 +54,7 @@
"description": "Holds a set of name/value pairs.",
"type": "object",
"additionalProperties": {
"type": "string",
"format": "string"
"type": "string"
}
}
}
Expand Down Expand Up @@ -119,8 +117,7 @@
"properties": {
"stringValue": {
"description": "Used for values of type STRING, DNS_NAME, EMAIL_ADDRESS, and URI",
"type": "string",
"format": "string"
"type": "string"
},
"int64Value": {
"description": "Used for values of type INT64",
Expand All @@ -144,7 +141,7 @@
"timestampValue": {
"description": "Used for values of type TIMESTAMP",
"type": "string",
"format": "dateTime"
"format": "date-time"
},
"durationValue": {
"description": "Used for values of type DURATION",
Expand All @@ -161,8 +158,7 @@
"description": "Holds a set of name/value pairs.",
"type": "object",
"additionalProperties": {
"type": "string",
"format": "string"
"type": "string"
}
}
}
Expand Down Expand Up @@ -224,8 +220,7 @@
"description": "Holds a set of name/value pairs.",
"type": "object",
"additionalProperties": {
"type": "string",
"format": "string"
"type": "string"
}
}
}
Expand Down

0 comments on commit d3c0096

Please sign in to comment.