Skip to content

Commit 0afe1d3

Browse files
committed
Merge pull request OAI#283 from swagger-api/2.0_fixes
2.0 fixes
2 parents 8973ffb + cd6b286 commit 0afe1d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2268
-368
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"version": "1.0.0",
5+
"title": "Swagger Petstore",
6+
"description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification",
7+
"termsOfService": "http://helloreverb.com/terms/",
8+
"contact": {
9+
"name": "Wordnik API Team"
10+
},
11+
"license": {
12+
"name": "MIT"
13+
}
14+
},
15+
"host": "petstore.swagger.wordnik.com",
16+
"basePath": "/api",
17+
"schemes": [
18+
"http"
19+
],
20+
"consumes": [
21+
"application/json"
22+
],
23+
"produces": [
24+
"application/json"
25+
],
26+
"paths": {
27+
"/pets": {
28+
"get": {
29+
"description": "Returns all pets from the system that the user has access to",
30+
"produces": [
31+
"application/json"
32+
],
33+
"responses": {
34+
"200": {
35+
"description": "A list of pets.",
36+
"schema": {
37+
"type": "array",
38+
"items": {
39+
"$ref": "#/definitions/pet"
40+
}
41+
}
42+
}
43+
}
44+
}
45+
}
46+
},
47+
"definitions": {
48+
"pet": {
49+
"required": [
50+
"id",
51+
"name"
52+
],
53+
"properties": {
54+
"id": {
55+
"type": "integer",
56+
"format": "int64"
57+
},
58+
"name": {
59+
"type": "string"
60+
},
61+
"tag": {
62+
"type": "string"
63+
}
64+
}
65+
}
66+
}
67+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"title": "Swagger Sample App",
3+
"description": "This is a sample server Petstore server.",
4+
"termsOfService": "http://swagger.io/terms/",
5+
"contact": {
6+
"name": "API Support",
7+
"url": "http://www.swagger.io/support",
8+
"email": "[email protected]"
9+
},
10+
"license": {
11+
"name": "Apache 2.0",
12+
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
13+
},
14+
"version": "1.0.1"
15+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"description": "Find more info here",
3+
"url": "https://swagger.io"
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"title": "Swagger Sample App",
3+
"version": "1.0.1"
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"description": "Find more info here"
3+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"description": "This is a sample server Petstore server.",
3+
"termsOfService": "http://swagger.io/terms/",
4+
"contact": {
5+
"name": "API Support",
6+
"url": "http://www.swagger.io/support",
7+
"email": "[email protected]"
8+
},
9+
"license": {
10+
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
11+
}
12+
}

fixtures/v2.0/json/models/modelWithArrayRef.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"children": {
1111
"type": "array",
1212
"items": {
13-
"$ref": "Person"
13+
"$ref": "#/definitions/Person"
1414
}
1515
}
1616
}
Lines changed: 74 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,5 @@
11
{
22
"definitions": {
3-
"Cat": {
4-
"description": "A representation of a cat",
5-
"allOf": [
6-
{ "$ref": "#/models/Pet" },
7-
{
8-
"properties": {
9-
"huntingSkill": {
10-
"type": "string",
11-
"description": "The measured skill for hunting",
12-
"default": "lazy",
13-
"enum": ["clueless", "lazy", "adventurous", "aggressive"]
14-
}
15-
},
16-
"required": [ "huntingSkill" ]
17-
}
18-
]
19-
},
20-
"Dog": {
21-
"description": "A representation of a dog",
22-
"allOf": [
23-
{ "$ref": "#/models/Pet" },
24-
{
25-
"properties": {
26-
"packSize": {
27-
"type": "integer",
28-
"format": "int32",
29-
"description": "the size of the pack the dog is from",
30-
"default": 0,
31-
"minimum": 0
32-
}
33-
},
34-
"required": [ "name", "packSize" ]
35-
}
36-
]
37-
},
38-
"Fish": {
39-
"description": "A representation of a fish",
40-
"allOf": [
41-
{ "$ref": "#/models/Pet" },
42-
{
43-
"properties": {
44-
"fins": {
45-
"type": "integer",
46-
"format": "int32",
47-
"description": "count of fins",
48-
"minimum": 0
49-
}
50-
},
51-
"required": [ "fins" ]
52-
}
53-
]
54-
},
553
"Pet": {
564
"discriminator": "petType",
575
"properties": {
@@ -62,7 +10,79 @@
6210
"type": "string"
6311
}
6412
},
65-
"required": [ "name", "petType" ]
13+
"required": [
14+
"name",
15+
"petType"
16+
]
6617
}
18+
},
19+
"Cat": {
20+
"description": "A representation of a cat",
21+
"allOf": [
22+
{
23+
"$ref": "#/definitions/Pet"
24+
},
25+
{
26+
"properties": {
27+
"huntingSkill": {
28+
"type": "string",
29+
"description": "The measured skill for hunting",
30+
"default": "lazy",
31+
"enum": [
32+
"clueless",
33+
"lazy",
34+
"adventurous",
35+
"aggressive"
36+
]
37+
}
38+
},
39+
"required": [
40+
"huntingSkill"
41+
]
42+
}
43+
]
44+
},
45+
"Dog": {
46+
"description": "A representation of a dog",
47+
"allOf": [
48+
{
49+
"$ref": "#/definitions/Pet"
50+
},
51+
{
52+
"properties": {
53+
"packSize": {
54+
"type": "integer",
55+
"format": "int32",
56+
"description": "the size of the pack the dog is from",
57+
"default": 0,
58+
"minimum": 0
59+
}
60+
},
61+
"required": [
62+
"packSize"
63+
]
64+
}
65+
]
66+
},
67+
"Fish": {
68+
"description": "A representation of a fish",
69+
"allOf": [
70+
{
71+
"$ref": "#/definitions/Pet"
72+
},
73+
{
74+
"properties": {
75+
"fins": {
76+
"type": "integer",
77+
"format": "int32",
78+
"description": "count of fins",
79+
"minimum": 0
80+
}
81+
},
82+
"required": [
83+
"fins"
84+
]
85+
}
86+
]
6787
}
68-
}
88+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"type": "array",
33
"items": {
4-
"$ref": "ComplexType"
4+
"$ref": "#/definitions/ComplexType"
55
}
66
}

fixtures/v2.0/json/models/properties/propertyWithRef.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)