mirror of
https://github.com/ilyakooo0/compaREST.git
synced 2024-09-11 14:35:25 +03:00
Add some JSON tests (#39)
This commit is contained in:
parent
241c2eb377
commit
3d2b3f5dba
29
test/golden/common/enum-anyof/a.yaml
Normal file
29
test/golden/common/enum-anyof/a.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
openapi: "3.0.0"
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Test
|
||||
servers:
|
||||
- url: http://localhost/
|
||||
paths:
|
||||
/test:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
responses:
|
||||
'200':
|
||||
description: test
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
components:
|
||||
schemas:
|
||||
Test:
|
||||
anyOf:
|
||||
- enum:
|
||||
- "foo"
|
||||
- enum:
|
||||
- "bar"
|
27
test/golden/common/enum-anyof/b.yaml
Normal file
27
test/golden/common/enum-anyof/b.yaml
Normal file
@ -0,0 +1,27 @@
|
||||
openapi: "3.0.0"
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Test
|
||||
servers:
|
||||
- url: http://localhost/
|
||||
paths:
|
||||
/test:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
responses:
|
||||
'200':
|
||||
description: test
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
components:
|
||||
schemas:
|
||||
Test:
|
||||
enum:
|
||||
- "foo"
|
||||
- "bar"
|
1
test/golden/common/enum-anyof/trace-tree.yaml
Normal file
1
test/golden/common/enum-anyof/trace-tree.yaml
Normal file
@ -0,0 +1 @@
|
||||
Right: []
|
1
test/golden/common/id/trace-tree.yaml
Normal file
1
test/golden/common/id/trace-tree.yaml
Normal file
@ -0,0 +1 @@
|
||||
Right: []
|
25
test/golden/common/maximum-lowered/a.yaml
Normal file
25
test/golden/common/maximum-lowered/a.yaml
Normal file
@ -0,0 +1,25 @@
|
||||
openapi: "3.0.0"
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Test
|
||||
servers:
|
||||
- url: http://localhost/
|
||||
paths:
|
||||
/test:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
responses:
|
||||
'200':
|
||||
description: test
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
components:
|
||||
schemas:
|
||||
Test:
|
||||
maximum: 3
|
25
test/golden/common/maximum-lowered/b.yaml
Normal file
25
test/golden/common/maximum-lowered/b.yaml
Normal file
@ -0,0 +1,25 @@
|
||||
openapi: "3.0.0"
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Test
|
||||
servers:
|
||||
- url: http://localhost/
|
||||
paths:
|
||||
/test:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
responses:
|
||||
'200':
|
||||
description: test
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
components:
|
||||
schemas:
|
||||
Test:
|
||||
maximum: 2
|
10
test/golden/common/maximum-lowered/trace-tree.yaml
Normal file
10
test/golden/common/maximum-lowered/trace-tree.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
Left:
|
||||
OpenApiPathsStep:
|
||||
PathStep "/test":
|
||||
PostStep:
|
||||
OperationRequestBodyStep:
|
||||
InlineStep:
|
||||
MediaTypeStep application/json:
|
||||
MediaTypeSchema:
|
||||
ReferencedStep (Reference {getReference = "Test"}):
|
||||
MaximumFields: MatchingMaximumWeak (Inclusive 2.0) (Inclusive 3.0)
|
33
test/golden/common/property-removed/a.yaml
Normal file
33
test/golden/common/property-removed/a.yaml
Normal file
@ -0,0 +1,33 @@
|
||||
openapi: "3.0.0"
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Test
|
||||
servers:
|
||||
- url: http://localhost/
|
||||
paths:
|
||||
/test:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
responses:
|
||||
'200':
|
||||
description: test
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
components:
|
||||
schemas:
|
||||
Test:
|
||||
required:
|
||||
- property1
|
||||
- property2
|
||||
properties:
|
||||
property1:
|
||||
type: string
|
||||
property2:
|
||||
type: number
|
||||
additionalProperties: false
|
30
test/golden/common/property-removed/b.yaml
Normal file
30
test/golden/common/property-removed/b.yaml
Normal file
@ -0,0 +1,30 @@
|
||||
openapi: "3.0.0"
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Test
|
||||
servers:
|
||||
- url: http://localhost/
|
||||
paths:
|
||||
/test:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
responses:
|
||||
'200':
|
||||
description: test
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
components:
|
||||
schemas:
|
||||
Test:
|
||||
required:
|
||||
- property1
|
||||
properties:
|
||||
property1:
|
||||
type: string
|
||||
additionalProperties: false
|
17
test/golden/common/property-removed/trace-tree.yaml
Normal file
17
test/golden/common/property-removed/trace-tree.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
Left:
|
||||
OpenApiPathsStep:
|
||||
PathStep "/test":
|
||||
PostStep:
|
||||
OperationResponsesStep:
|
||||
ResponseCodeStep 200:
|
||||
InlineStep:
|
||||
ResponseMediaObject application/json:
|
||||
MediaTypeSchema:
|
||||
ReferencedStep (Reference {getReference = "Test"}):
|
||||
PropertiesFields: PropertyNowRequired "property2"
|
||||
OperationRequestBodyStep:
|
||||
InlineStep:
|
||||
MediaTypeStep application/json:
|
||||
MediaTypeSchema:
|
||||
ReferencedStep (Reference {getReference = "Test"}):
|
||||
PropertiesFields: UnexpectedProperty "property2"
|
32
test/golden/common/property-required/a.yaml
Normal file
32
test/golden/common/property-required/a.yaml
Normal file
@ -0,0 +1,32 @@
|
||||
openapi: "3.0.0"
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Test
|
||||
servers:
|
||||
- url: http://localhost/
|
||||
paths:
|
||||
/test:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
responses:
|
||||
'200':
|
||||
description: test
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
components:
|
||||
schemas:
|
||||
Test:
|
||||
required:
|
||||
- property1
|
||||
properties:
|
||||
property1:
|
||||
type: string
|
||||
property2:
|
||||
type: number
|
||||
additionalProperties: false
|
33
test/golden/common/property-required/b.yaml
Normal file
33
test/golden/common/property-required/b.yaml
Normal file
@ -0,0 +1,33 @@
|
||||
openapi: "3.0.0"
|
||||
info:
|
||||
version: 1.0.0
|
||||
title: Test
|
||||
servers:
|
||||
- url: http://localhost/
|
||||
paths:
|
||||
/test:
|
||||
post:
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
responses:
|
||||
'200':
|
||||
description: test
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Test"
|
||||
components:
|
||||
schemas:
|
||||
Test:
|
||||
required:
|
||||
- property1
|
||||
- property2
|
||||
properties:
|
||||
property1:
|
||||
type: string
|
||||
property2:
|
||||
type: number
|
||||
additionalProperties: false
|
10
test/golden/common/property-required/trace-tree.yaml
Normal file
10
test/golden/common/property-required/trace-tree.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
Left:
|
||||
OpenApiPathsStep:
|
||||
PathStep "/test":
|
||||
PostStep:
|
||||
OperationRequestBodyStep:
|
||||
InlineStep:
|
||||
MediaTypeStep application/json:
|
||||
MediaTypeSchema:
|
||||
ReferencedStep (Reference {getReference = "Test"}):
|
||||
PropertiesFields: PropertyNowRequired "property2"
|
Loading…
Reference in New Issue
Block a user