swagger-blocks 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/swagger/blocks.rb +5 -0
- data/lib/swagger/blocks/version.rb +1 -1
- data/spec/lib/swagger_v2_api_declaration.json +10 -20
- data/spec/lib/swagger_v2_blocks_spec.rb +8 -16
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2873ec48557e17844d3484479b9bf11a32305299
|
4
|
+
data.tar.gz: c37cefb45dd5ba969c60d36fd841673a2b5675c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f0e29229dedb44d9b17629417ed2a959f6ef33103c1a33db1d99ba769ef3221b8f02fb7149c98f13510a37b6e69f8129416bc6265cf87b7b27beaf06a6b68eb
|
7
|
+
data.tar.gz: 86d62c052a3e4934756c51e33b68e50611365cc7e6dcc1cb591495c37749176bef911af487d16747830bc12662c725959918e64d174d217c1bd47a06da4d8c79
|
data/README.md
CHANGED
@@ -413,6 +413,7 @@ Throw a ★ on it! :)
|
|
413
413
|
|
414
414
|
## Release notes
|
415
415
|
|
416
|
+
* v1.3.3: Bugfix to allow `parameter` inside `swagger_path`.
|
416
417
|
* v1.3.2: Bugfix to allow `property` inside `items` for rare extended schema uses.
|
417
418
|
* v1.3.1: Bugfix to allow nested objects via `property` nested in `property`.
|
418
419
|
* v1.3.0: Added support for condensed syntax via inline keys on every block.
|
data/lib/swagger/blocks.rb
CHANGED
@@ -499,6 +499,11 @@ module Swagger
|
|
499
499
|
raise ArgumentError.new("#{name} not in #{OPERATION_TYPES}") if !OPERATION_TYPES.include?(op)
|
500
500
|
self.data[op] = Swagger::Blocks::OperationNode.call(version: version, inline_keys: inline_keys, &block)
|
501
501
|
end
|
502
|
+
|
503
|
+
def parameter(inline_keys = nil, &block)
|
504
|
+
self.data[:parameters] ||= []
|
505
|
+
self.data[:parameters] << Swagger::Blocks::ParameterNode.call(version: version, inline_keys: inline_keys, &block)
|
506
|
+
end
|
502
507
|
end
|
503
508
|
|
504
509
|
# v1.2: http://goo.gl/PvwUXj#523-operation-object
|
@@ -133,6 +133,16 @@
|
|
133
133
|
}
|
134
134
|
},
|
135
135
|
"/pets/{id}": {
|
136
|
+
"parameters": [
|
137
|
+
{
|
138
|
+
"name": "id",
|
139
|
+
"in": "path",
|
140
|
+
"description": "ID of pet",
|
141
|
+
"required": true,
|
142
|
+
"type": "integer",
|
143
|
+
"format": "int64"
|
144
|
+
}
|
145
|
+
],
|
136
146
|
"get": {
|
137
147
|
"description": "Returns a user based on a single ID, if the user does not have access to the pet",
|
138
148
|
"operationId": "findPetById",
|
@@ -142,16 +152,6 @@
|
|
142
152
|
"text/xml",
|
143
153
|
"text/html"
|
144
154
|
],
|
145
|
-
"parameters": [
|
146
|
-
{
|
147
|
-
"name": "id",
|
148
|
-
"in": "path",
|
149
|
-
"description": "ID of pet to fetch",
|
150
|
-
"required": true,
|
151
|
-
"type": "integer",
|
152
|
-
"format": "int64"
|
153
|
-
}
|
154
|
-
],
|
155
155
|
"responses": {
|
156
156
|
"200": {
|
157
157
|
"description": "pet response",
|
@@ -181,16 +181,6 @@
|
|
181
181
|
"delete": {
|
182
182
|
"description": "deletes a single pet based on the ID supplied",
|
183
183
|
"operationId": "deletePet",
|
184
|
-
"parameters": [
|
185
|
-
{
|
186
|
-
"name": "id",
|
187
|
-
"in": "path",
|
188
|
-
"description": "ID of pet to delete",
|
189
|
-
"required": true,
|
190
|
-
"type": "integer",
|
191
|
-
"format": "int64"
|
192
|
-
}
|
193
|
-
],
|
194
184
|
"responses": {
|
195
185
|
"204": {
|
196
186
|
"description": "pet deleted"
|
@@ -121,6 +121,14 @@ class PetControllerV2
|
|
121
121
|
end
|
122
122
|
|
123
123
|
swagger_path '/pets/{id}' do
|
124
|
+
parameter do
|
125
|
+
key :name, :id
|
126
|
+
key :in, :path
|
127
|
+
key :description, 'ID of pet'
|
128
|
+
key :required, true
|
129
|
+
key :type, :integer
|
130
|
+
key :format, :int64
|
131
|
+
end
|
124
132
|
operation :get do
|
125
133
|
key :description, 'Returns a user based on a single ID, if the user does not have access to the pet'
|
126
134
|
key :operationId, 'findPetById'
|
@@ -130,14 +138,6 @@ class PetControllerV2
|
|
130
138
|
'text/xml',
|
131
139
|
'text/html',
|
132
140
|
]
|
133
|
-
parameter do
|
134
|
-
key :name, :id
|
135
|
-
key :in, :path
|
136
|
-
key :description, 'ID of pet to fetch'
|
137
|
-
key :required, true
|
138
|
-
key :type, :integer
|
139
|
-
key :format, :int64
|
140
|
-
end
|
141
141
|
response 200 do
|
142
142
|
key :description, 'pet response'
|
143
143
|
schema do
|
@@ -158,14 +158,6 @@ class PetControllerV2
|
|
158
158
|
operation :delete do
|
159
159
|
key :description, 'deletes a single pet based on the ID supplied'
|
160
160
|
key :operationId, 'deletePet'
|
161
|
-
parameter do
|
162
|
-
key :name, :id
|
163
|
-
key :in, :path
|
164
|
-
key :description, 'ID of pet to delete'
|
165
|
-
key :required, true
|
166
|
-
key :type, :integer
|
167
|
-
key :format, :int64
|
168
|
-
end
|
169
161
|
response 204 do
|
170
162
|
key :description, 'pet deleted'
|
171
163
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagger-blocks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Fotinakis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.2.2
|
114
114
|
signing_key:
|
115
115
|
specification_version: 4
|
116
116
|
summary: Define and serve live-updating Swagger JSON for Ruby apps.
|
@@ -121,4 +121,3 @@ test_files:
|
|
121
121
|
- spec/lib/swagger_v2_api_declaration.json
|
122
122
|
- spec/lib/swagger_v2_blocks_spec.rb
|
123
123
|
- spec/spec_helper.rb
|
124
|
-
has_rdoc:
|