Add some JSON tests (#39)
commit3d2b3f5dba267f615cbdc2632a8bb8ba92773fdf
authormniip <mniip@users.noreply.github.com>
dateFri 23 Apr 2021, 11:11 (5 years ago)
parent241c2eb
test/golden/common/enum-anyof/a.yamlnew file+29
@@ -0,0 +1,29 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test"
15+ responses:
16+ '200':
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test"
22+components:
23+ schemas:
24+ Test:
25+ anyOf:
26+ - enum:
27+ - "foo"
28+ - enum:
29+ - "bar"
test/golden/common/enum-anyof/b.yamlnew file+27
@@ -0,0 +1,27 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test"
15+ responses:
16+ '200':
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test"
22+components:
23+ schemas:
24+ Test:
25+ enum:
26+ - "foo"
27+ - "bar"
test/golden/common/enum-anyof/trace-tree.yamlnew file+1
@@ -0,0 +1 @@
1+Right: []
test/golden/common/id/trace-tree.yamlnew file+1
@@ -0,0 +1 @@
1+Right: []
test/golden/common/maximum-lowered/a.yamlnew file+25
@@ -0,0 +1,25 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test"
15+ responses:
16+ '200':
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test"
22+components:
23+ schemas:
24+ Test:
25+ maximum: 3
test/golden/common/maximum-lowered/b.yamlnew file+25
@@ -0,0 +1,25 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test"
15+ responses:
16+ '200':
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test"
22+components:
23+ schemas:
24+ Test:
25+ maximum: 2
test/golden/common/maximum-lowered/trace-tree.yamlnew file+10
@@ -0,0 +1,10 @@
1+Left:
2+ OpenApiPathsStep:
3+ PathStep "/test":
4+ PostStep:
5+ OperationRequestBodyStep:
6+ InlineStep:
7+ MediaTypeStep application/json:
8+ MediaTypeSchema:
9+ ReferencedStep (Reference {getReference = "Test"}):
10+ MaximumFields: MatchingMaximumWeak (Inclusive 2.0) (Inclusive 3.0)
test/golden/common/property-removed/a.yamlnew file+33
@@ -0,0 +1,33 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test"
15+ responses:
16+ '200':
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test"
22+components:
23+ schemas:
24+ Test:
25+ required:
26+ - property1
27+ - property2
28+ properties:
29+ property1:
30+ type: string
31+ property2:
32+ type: number
33+ additionalProperties: false
test/golden/common/property-removed/b.yamlnew file+30
@@ -0,0 +1,30 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test"
15+ responses:
16+ '200':
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test"
22+components:
23+ schemas:
24+ Test:
25+ required:
26+ - property1
27+ properties:
28+ property1:
29+ type: string
30+ additionalProperties: false
test/golden/common/property-removed/trace-tree.yamlnew file+17
@@ -0,0 +1,17 @@
1+Left:
2+ OpenApiPathsStep:
3+ PathStep "/test":
4+ PostStep:
5+ OperationResponsesStep:
6+ ResponseCodeStep 200:
7+ InlineStep:
8+ ResponseMediaObject application/json:
9+ MediaTypeSchema:
10+ ReferencedStep (Reference {getReference = "Test"}):
11+ PropertiesFields: PropertyNowRequired "property2"
12+ OperationRequestBodyStep:
13+ InlineStep:
14+ MediaTypeStep application/json:
15+ MediaTypeSchema:
16+ ReferencedStep (Reference {getReference = "Test"}):
17+ PropertiesFields: UnexpectedProperty "property2"
test/golden/common/property-required/a.yamlnew file+32
@@ -0,0 +1,32 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test"
15+ responses:
16+ '200':
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test"
22+components:
23+ schemas:
24+ Test:
25+ required:
26+ - property1
27+ properties:
28+ property1:
29+ type: string
30+ property2:
31+ type: number
32+ additionalProperties: false
test/golden/common/property-required/b.yamlnew file+33
@@ -0,0 +1,33 @@
1+openapi: "3.0.0"
2+info:
3+ version: 1.0.0
4+ title: Test
5+servers:
6+ - url: http://localhost/
7+paths:
8+ /test:
9+ post:
10+ requestBody:
11+ content:
12+ application/json:
13+ schema:
14+ $ref: "#/components/schemas/Test"
15+ responses:
16+ '200':
17+ description: test
18+ content:
19+ application/json:
20+ schema:
21+ $ref: "#/components/schemas/Test"
22+components:
23+ schemas:
24+ Test:
25+ required:
26+ - property1
27+ - property2
28+ properties:
29+ property1:
30+ type: string
31+ property2:
32+ type: number
33+ additionalProperties: false
test/golden/common/property-required/trace-tree.yamlnew file+10
@@ -0,0 +1,10 @@
1+Left:
2+ OpenApiPathsStep:
3+ PathStep "/test":
4+ PostStep:
5+ OperationRequestBodyStep:
6+ InlineStep:
7+ MediaTypeStep application/json:
8+ MediaTypeSchema:
9+ ReferencedStep (Reference {getReference = "Test"}):
10+ PropertiesFields: PropertyNowRequired "property2"