swagger-core 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/swagger.rb +1 -0
- data/lib/swagger/boolean.rb +13 -0
- data/lib/swagger/builder.rb +1 -1
- data/lib/swagger/v2/api.rb +8 -7
- data/lib/swagger/v2/deterministic_json_schema.rb +130 -0
- data/lib/swagger/v2/example.rb +1 -1
- data/lib/swagger/v2/header.rb +22 -0
- data/lib/swagger/v2/operation.rb +21 -8
- data/lib/swagger/v2/parameter.rb +3 -16
- data/lib/swagger/v2/path.rb +8 -0
- data/lib/swagger/v2/response.rb +2 -1
- data/lib/swagger/v2/security_requirement.rb +12 -0
- data/lib/swagger/v2/security_scheme.rb +25 -0
- data/lib/swagger/version.rb +1 -1
- data/resources/schemas/swagger/v2.0/schema.json +1244 -293
- data/spec/fixtures/petstore-full.yaml +123 -12
- data/spec/fixtures/swagger.yaml +1 -1
- data/spec/swagger/api_spec.rb +1 -1
- data/spec/swagger/builder_spec.rb +2 -2
- data/spec/swagger/swagger_spec.rb +1 -1
- metadata +8 -3
@@ -34,10 +34,9 @@ paths:
|
|
34
34
|
description: foos to bar by
|
35
35
|
required: false
|
36
36
|
type: array
|
37
|
-
|
37
|
+
collectionFormat: csv
|
38
38
|
items:
|
39
39
|
type: string
|
40
|
-
collectionFormat: something # what other formats exist?
|
41
40
|
get:
|
42
41
|
tags:
|
43
42
|
- Things
|
@@ -51,6 +50,11 @@ paths:
|
|
51
50
|
|
52
51
|
Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.
|
53
52
|
operationId: Get Pets
|
53
|
+
security:
|
54
|
+
- githubAuth:
|
55
|
+
- "user:read"
|
56
|
+
- "user:write"
|
57
|
+
- internalApiKey: []
|
54
58
|
produces:
|
55
59
|
- application/json
|
56
60
|
parameters:
|
@@ -59,17 +63,15 @@ paths:
|
|
59
63
|
description: tags to filter by
|
60
64
|
required: false
|
61
65
|
type: array
|
62
|
-
|
66
|
+
collectionFormat: csv
|
63
67
|
items:
|
64
68
|
type: string
|
65
|
-
collectionFormat: something
|
66
69
|
- name: limit
|
67
70
|
in: query
|
68
71
|
description: maximum number of results to return
|
69
72
|
required: false
|
70
73
|
type: integer
|
71
74
|
format: int32
|
72
|
-
collectionFormat: something
|
73
75
|
responses:
|
74
76
|
200:
|
75
77
|
description: pet response
|
@@ -79,9 +81,9 @@ paths:
|
|
79
81
|
Pet:
|
80
82
|
$ref: '#/models/Pet'
|
81
83
|
headers:
|
82
|
-
|
84
|
+
is-dog:
|
83
85
|
type: boolean
|
84
|
-
|
86
|
+
is-cat:
|
85
87
|
type: boolean
|
86
88
|
examples:
|
87
89
|
application/json:
|
@@ -100,9 +102,9 @@ paths:
|
|
100
102
|
Pet:
|
101
103
|
$ref: '#/models/Pet'
|
102
104
|
headers:
|
103
|
-
|
105
|
+
is-dog:
|
104
106
|
type: boolean
|
105
|
-
|
107
|
+
is-cat:
|
106
108
|
type: boolean
|
107
109
|
examples:
|
108
110
|
application/json:
|
@@ -129,6 +131,115 @@ definitions:
|
|
129
131
|
type: string
|
130
132
|
tag:
|
131
133
|
type: string
|
132
|
-
|
133
|
-
|
134
|
-
|
134
|
+
securityDefinitions:
|
135
|
+
githubAccessCode:
|
136
|
+
type: "oauth2"
|
137
|
+
scopes:
|
138
|
+
user: |-
|
139
|
+
Grants read/write access to profile info only. Note that this scope
|
140
|
+
includes user:email and user:follow.
|
141
|
+
user:email: |-
|
142
|
+
Grants read access to a user’s email addresses.
|
143
|
+
user:follow: |-
|
144
|
+
Grants access to follow or unfollow other users.
|
145
|
+
public_repo: |-
|
146
|
+
Grants read/write access to code, commit statuses, and deployment
|
147
|
+
statuses for public repositories and organizations.
|
148
|
+
repo: |-
|
149
|
+
Grants read/write access to code, commit statuses, and deployment
|
150
|
+
statuses for public and private repositories and organizations.
|
151
|
+
repo_deployment: |-
|
152
|
+
Grants access to deployment statuses for public and private
|
153
|
+
repositories. This scope is only necessary to grant other users or services access to deployment statuses, without granting access to the code.
|
154
|
+
repo:status: |-
|
155
|
+
Grants read/write access to public and private repository commit
|
156
|
+
statuses. This scope is only necessary to grant other users or services
|
157
|
+
access to private repository commit statuses without granting access to the code.
|
158
|
+
delete_repo: |-
|
159
|
+
Grants access to delete adminable repositories.
|
160
|
+
notifications: |-
|
161
|
+
Grants read access to a user’s notifications. repo also provides
|
162
|
+
this access.
|
163
|
+
gist: |-
|
164
|
+
Grants write access to gists.
|
165
|
+
read:repo_hook: |-
|
166
|
+
Grants read and ping access to hooks in public or private repositories.
|
167
|
+
write:repo_hook: |-
|
168
|
+
Grants read, write, and ping access to hooks in public or private repositories.
|
169
|
+
admin:repo_hook: |-
|
170
|
+
Grants read, write, ping, and delete access to hooks in public or private
|
171
|
+
repositories.
|
172
|
+
read:org: |-
|
173
|
+
Read-only access to organization, teams, and membership.
|
174
|
+
write:org: |-
|
175
|
+
Publicize and unpublicize organization membership.
|
176
|
+
admin:org: |-
|
177
|
+
Fully manage organization, teams, and memberships.
|
178
|
+
read:public_key: |-
|
179
|
+
List and view details for public keys.
|
180
|
+
write:public_key: |-
|
181
|
+
Create, list, and view details for public keys.
|
182
|
+
admin:public_key: |-
|
183
|
+
Fully manage public keys.
|
184
|
+
flow: "accessCode"
|
185
|
+
authorizationUrl: "https://github.com/login/oauth/authorize"
|
186
|
+
tokenUrl: "https://github.com/login/oauth/access_token"
|
187
|
+
petstoreImplicit:
|
188
|
+
type: "oauth2"
|
189
|
+
scopes:
|
190
|
+
user: |-
|
191
|
+
Grants read/write access to profile info only. Note that this scope
|
192
|
+
includes user:email and user:follow.
|
193
|
+
user:email: |-
|
194
|
+
Grants read access to a user’s email addresses.
|
195
|
+
user:follow: |-
|
196
|
+
Grants access to follow or unfollow other users.
|
197
|
+
public_repo: |-
|
198
|
+
Grants read/write access to code, commit statuses, and deployment statuses
|
199
|
+
for public repositories and organizations.
|
200
|
+
repo: |-
|
201
|
+
Grants read/write access to code, commit statuses, and deployment statuses
|
202
|
+
for public and private repositories and organizations.
|
203
|
+
repo_deployment: |-
|
204
|
+
Grants access to deployment statuses for public and private repositories. This
|
205
|
+
scope is only necessary to grant other users or services access to deployment statuses, without granting access to the code.
|
206
|
+
repo:status: |-
|
207
|
+
Grants read/write access to public and private repository commit statuses. This
|
208
|
+
scope is only necessary to grant other users or services access to private repository
|
209
|
+
commit statuses without granting access to the code.
|
210
|
+
delete_repo: |-
|
211
|
+
Grants access to delete adminable repositories.
|
212
|
+
notifications: |-
|
213
|
+
Grants read access to a user’s notifications. repo also provides this access.
|
214
|
+
gist: |-
|
215
|
+
Grants write access to gists.
|
216
|
+
read:repo_hook: |-
|
217
|
+
Grants read and ping access to hooks in public or private repositories.
|
218
|
+
write:repo_hook: |-
|
219
|
+
Grants read, write, and ping access to hooks in public or private repositories.
|
220
|
+
admin:repo_hook: |-
|
221
|
+
Grants read, write, ping, and delete access to hooks in public or private
|
222
|
+
repositories.
|
223
|
+
read:org: |-
|
224
|
+
Read-only access to organization, teams, and membership.
|
225
|
+
write:org: |-
|
226
|
+
Publicize and unpublicize organization membership.
|
227
|
+
admin:org: |-
|
228
|
+
Fully manage organization, teams, and memberships.
|
229
|
+
read:public_key: |-
|
230
|
+
List and view details for public keys.
|
231
|
+
write:public_key: |-
|
232
|
+
Create, list, and view details for public keys.
|
233
|
+
admin:public_key: |-
|
234
|
+
Fully manage public keys.
|
235
|
+
flow: "implicit"
|
236
|
+
authorizationUrl: "http://petstore.swagger.wordnik.com/oauth/dialog"
|
237
|
+
internalApiKey:
|
238
|
+
type: "apiKey"
|
239
|
+
in: "header"
|
240
|
+
name: "api_key"
|
241
|
+
security:
|
242
|
+
- githubAccessCode:
|
243
|
+
- "user"
|
244
|
+
- "gist"
|
245
|
+
- internalApiKey: []
|
data/spec/fixtures/swagger.yaml
CHANGED
data/spec/swagger/api_spec.rb
CHANGED
@@ -9,11 +9,11 @@ module Swagger
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it 'raises if the value cannot be coerced to match the field' do
|
12
|
-
expect { builder.
|
12
|
+
expect { builder.info = 'foo' }.to raise_error(Hashie::CoercionError)
|
13
13
|
end
|
14
14
|
|
15
15
|
it 'sets the field' do
|
16
|
-
expect { builder.swagger = 2.0 }.to change { builder.swagger }.from(nil).to(2.0)
|
16
|
+
expect { builder.swagger = 2.0 }.to change { builder.swagger }.from(nil).to('2.0')
|
17
17
|
end
|
18
18
|
|
19
19
|
it 'allows complex types to be set via a block' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagger-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Lincoln
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- lib/swagger.rb
|
173
173
|
- lib/swagger/api.rb
|
174
174
|
- lib/swagger/attachable.rb
|
175
|
+
- lib/swagger/boolean.rb
|
175
176
|
- lib/swagger/builder.rb
|
176
177
|
- lib/swagger/mime_type.rb
|
177
178
|
- lib/swagger/notes.md
|
@@ -181,12 +182,16 @@ files:
|
|
181
182
|
- lib/swagger/uri.rb
|
182
183
|
- lib/swagger/uri_template.rb
|
183
184
|
- lib/swagger/v2/api.rb
|
185
|
+
- lib/swagger/v2/deterministic_json_schema.rb
|
184
186
|
- lib/swagger/v2/example.rb
|
187
|
+
- lib/swagger/v2/header.rb
|
185
188
|
- lib/swagger/v2/info.rb
|
186
189
|
- lib/swagger/v2/operation.rb
|
187
190
|
- lib/swagger/v2/parameter.rb
|
188
191
|
- lib/swagger/v2/path.rb
|
189
192
|
- lib/swagger/v2/response.rb
|
193
|
+
- lib/swagger/v2/security_requirement.rb
|
194
|
+
- lib/swagger/v2/security_scheme.rb
|
190
195
|
- lib/swagger/v2/tag.rb
|
191
196
|
- lib/swagger/version.rb
|
192
197
|
- resources/schemas/json_schema/draft-04.json
|
@@ -220,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
225
|
version: '0'
|
221
226
|
requirements: []
|
222
227
|
rubyforge_project:
|
223
|
-
rubygems_version: 2.2
|
228
|
+
rubygems_version: 2.4.2
|
224
229
|
signing_key:
|
225
230
|
specification_version: 4
|
226
231
|
summary: Swagger parser for Ruby
|