Skip to content

Commit 7c47454

Browse files
committed
merged with 2.0
2 parents 87d52f0 + 3cd9426 commit 7c47454

File tree

126 files changed

+5252
-8
lines changed

Some content is hidden

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

126 files changed

+5252
-8
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
*.ipr
44
*.iws
55
target
6-
atlassian-ide-plugin.xml
6+
atlassian-ide-plugin.xml
7+
node_modules/
8+
Gemfile.lock

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: scala
2+
scala:
3+
- 2.10.4
4+
script:
5+
- npm install
6+
- gulp lint
7+
- sbt ++$TRAVIS_SCALA_VERSION test
8+
- mocha
9+
env:
10+
- VALIDATORS=tv4
11+
- VALIDATORS=zschema
12+
matrix:
13+
allow_failures:
14+
- env: VALIDATORS=tv4

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# The Swagger Specification
22

3+
[![Build Status](https://travis-ci.org/reverb/swagger-spec.svg?branch=master)](https://travis-ci.org/reverb/swagger-spec)
4+
35
![](https://raw.github.com/wordnik/swagger-spec/master/swagger-logo.jpg)
46
## Welcome to the Swagger Project!
57

@@ -15,6 +17,7 @@ This GitHub project is the starting point for Swagger.
1517
Here you will find the information you need about the Swagger Specification, a simple static sample of what it looks like,
1618
and some general information regarding the project.
1719

20+
<<<<<<< HEAD
1821
## Current Version - 1.2
1922

2023
The current version of the Swagger specification is 1.2 - and you can find it [here](versions/1.2.md).
@@ -120,14 +123,14 @@ These are third party tools generated by the Swagger community:
120123
- [gform-admin](https://github.com/stemey/gform-admin) - An alternative UI client for Swagger.
121124

122125
## Support
126+
=======
127+
## Planning Version - 2.0
123128

124-
The following methods are available to obtain support for Swagger:
129+
This repository contains the existing Swagger 1.2 specification as well as proposals for the 2.0 version.
125130

126-
- [The Swagger Google Group](https://groups.google.com/forum/#!forum/swagger-swaggersocket) - This would normally be your first stop to get support for Swagger. Here you can find previously asked question, and ask new ones. When asking a question, please provide as much information as you can regarding the environment you use (development language, library, versions.
127-
- The Issues tab of the respective project in GitHub. Please open feature requests and bugs here. If you're not sure you encountered a bug, or if it's a general usage question, please use the Google Group mentioned above.
128-
- IRC! you can find us on [freenode](irc://irc.freenode.net) in the channel #Swagger. You can talk with us directly there.
131+
## Structure
129132

130-
Keep in mind that if you have an issue with a specific community-driven library, you may want to ask in their respective support channels.
133+
Each section should contain v1.2 and v2.0 folders to avoid confusion between the versions.
131134

132135
## License
133136

build.sbt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name := "schema-test"
2+
3+
scalaVersion := "2.10.4"
4+
5+
libraryDependencies ++= Seq(
6+
"com.github.fge" % "json-schema-validator" % "2.2.5",
7+
"junit" % "junit" % "4.8.1" % "test",
8+
"org.scalatest" %% "scalatest" % "1.9.2" % "test"
9+
)
Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
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+
"email": "[email protected]",
11+
"url": "http://madskristensen.net"
12+
},
13+
"license": {
14+
"name": "MIT",
15+
"url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT"
16+
}
17+
},
18+
"host": "petstore.swagger.wordnik.com",
19+
"basePath": "/api",
20+
"schemes": [
21+
"http"
22+
],
23+
"consumes": [
24+
"application/json"
25+
],
26+
"produces": [
27+
"application/json"
28+
],
29+
"paths": {
30+
"/pets": {
31+
"get": {
32+
"description": "Returns all pets from the system that the user has access to",
33+
"operationId": "findPets",
34+
"produces": [
35+
"application/json",
36+
"application/xml",
37+
"text/xml",
38+
"text/html"
39+
],
40+
"parameters": [
41+
{
42+
"name": "tags",
43+
"in": "query",
44+
"description": "tags to filter by",
45+
"required": false,
46+
"type": "array",
47+
"items": {
48+
"type": "string"
49+
},
50+
"collectionFormat": "csv"
51+
},
52+
{
53+
"name": "limit",
54+
"in": "query",
55+
"description": "maximum number of results to return",
56+
"required": false,
57+
"type": "integer",
58+
"format": "int32"
59+
}
60+
],
61+
"responses": {
62+
"200": {
63+
"description": "pet response",
64+
"schema": {
65+
"type": "array",
66+
"items": {
67+
"$ref": "#/definitions/pet"
68+
}
69+
}
70+
},
71+
"default": {
72+
"description": "unexpected error",
73+
"schema": {
74+
"$ref": "#/definitions/errorModel"
75+
}
76+
}
77+
}
78+
},
79+
"post": {
80+
"description": "Creates a new pet in the store. Duplicates are allowed",
81+
"operationId": "addPet",
82+
"produces": [
83+
"application/json"
84+
],
85+
"parameters": [
86+
{
87+
"name": "pet",
88+
"in": "body",
89+
"description": "Pet to add to the store",
90+
"required": true,
91+
"schema": {
92+
"$ref": "#/definitions/newPet"
93+
}
94+
}
95+
],
96+
"responses": {
97+
"200": {
98+
"description": "pet response",
99+
"schema": {
100+
"$ref": "#/definitions/pet"
101+
}
102+
},
103+
"default": {
104+
"description": "unexpected error",
105+
"schema": {
106+
"$ref": "#/definitions/errorModel"
107+
}
108+
}
109+
}
110+
}
111+
},
112+
"/pets/{id}": {
113+
"get": {
114+
"description": "Returns a user based on a single ID, if the user does not have access to the pet",
115+
"operationId": "findPetById",
116+
"produces": [
117+
"application/json",
118+
"application/xml",
119+
"text/xml",
120+
"text/html"
121+
],
122+
"parameters": [
123+
{
124+
"name": "id",
125+
"in": "path",
126+
"description": "ID of pet to fetch",
127+
"required": true,
128+
"type": "integer",
129+
"format": "int64"
130+
}
131+
],
132+
"responses": {
133+
"200": {
134+
"description": "pet response",
135+
"schema": {
136+
"$ref": "#/definitions/pet"
137+
}
138+
},
139+
"default": {
140+
"description": "unexpected error",
141+
"schema": {
142+
"$ref": "ErrorModel"
143+
}
144+
}
145+
}
146+
},
147+
"delete": {
148+
"description": "deletes a single pet based on the ID supplied",
149+
"operationId": "deletePet",
150+
"parameters": [
151+
{
152+
"name": "id",
153+
"in": "path",
154+
"description": "ID of pet to delete",
155+
"required": true,
156+
"type": "integer",
157+
"format": "int64"
158+
}
159+
],
160+
"responses": {
161+
"204": {
162+
"description": "pet deleted"
163+
},
164+
"default": {
165+
"description": "unexpected error",
166+
"schema": {
167+
"$ref": "#/definitions/errorModel"
168+
}
169+
}
170+
}
171+
}
172+
}
173+
},
174+
"definitions": {
175+
"pet": {
176+
"required": [
177+
"id",
178+
"name"
179+
],
180+
"properties": {
181+
"id": {
182+
"type": "integer",
183+
"format": "int64"
184+
},
185+
"name": {
186+
"type": "string"
187+
},
188+
"tag": {
189+
"type": "string"
190+
}
191+
}
192+
},
193+
"newPet": {
194+
"allOf": [
195+
{
196+
"$ref": "pet"
197+
},
198+
{
199+
"required": [
200+
"name"
201+
],
202+
"properties": {
203+
"id": {
204+
"type": "integer",
205+
"format": "int64"
206+
}
207+
}
208+
}
209+
]
210+
},
211+
"errorModel": {
212+
"required": [
213+
"code",
214+
"message"
215+
],
216+
"properties": {
217+
"code": {
218+
"type": "integer",
219+
"format": "int32"
220+
},
221+
"message": {
222+
"type": "string"
223+
}
224+
}
225+
}
226+
}
227+
}

0 commit comments

Comments
 (0)