swagger-blocks 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87aac20d5b859685b2d9cc9ea4d754575fc5537e
4
- data.tar.gz: db8cf213ec618f5f294c5bd3720a64277d8d1c83
3
+ metadata.gz: f409735a8d6654efde3de5cf5f67283739973aec
4
+ data.tar.gz: 74e1cec936cca1fb9495eb068e37599ce2d02da0
5
5
  SHA512:
6
- metadata.gz: 95be424f669c95b24a7c5ac615997ce1b7dafa65ad7c0ab00d1cf7b26a74b50115b133cf7634807efd34a4341c954caf8fafd9e639306dd4361b622b0bc67f90
7
- data.tar.gz: 6d023103e6f7ca26f067f57406726a20795eed4fd0b92cf267aa92f4cf4bfe2d1099a65d55dbaf3f70396cd4f49aa1b48fefcfbc252c7af27e87951da78d5c1d
6
+ metadata.gz: 2bc8eb83e7033f17cdbe6be14e4b2dbd4086d202b1e064078561402da876cb5a3d9cdf8f35fd6d5332a77f7399e1810f91ec585194230a2ec8521be863f37b23
7
+ data.tar.gz: 6f9f559471c11ea85917140b0b116bf0e97174564d08ab5eb8648ae824d64110c48e8280e7cc06a0e1423827658fbf7d230aa4763e61e158f518036d5a377ae8
data/README.md CHANGED
@@ -413,7 +413,8 @@ Throw a ★ on it! :)
413
413
 
414
414
  ## Release notes
415
415
 
416
- * v1.3.1: Bugfix allow nested objects via `property` nested in `property`.
416
+ * v1.3.2: Bugfix to allow `property` inside `items` for rare extended schema uses.
417
+ * v1.3.1: Bugfix to allow nested objects via `property` nested in `property`.
417
418
  * v1.3.0: Added support for condensed syntax via inline keys on every block.
418
419
  * v1.2.0: Improved support for `$ref` Path Item Object parameters.
419
420
  * v1.1.3: Rename tags directive to tag for consistency.
@@ -692,7 +692,13 @@ module Swagger
692
692
 
693
693
  # v1.2:
694
694
  # v2.0:
695
- class ItemsNode < Node; end
695
+ class ItemsNode < Node
696
+ def property(name, inline_keys = nil, &block)
697
+ self.data[:properties] ||= Swagger::Blocks::PropertiesNode.new
698
+ self.data[:properties].version = version
699
+ self.data[:properties].property(name, inline_keys, &block)
700
+ end
701
+ end
696
702
 
697
703
  # v1.2: http://goo.gl/PvwUXj#524-parameter-object
698
704
  # v2.0: https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#parameter-object
@@ -1,5 +1,5 @@
1
1
  module Swagger
2
2
  module Blocks
3
- VERSION = '1.3.1'
3
+ VERSION = '1.3.2'
4
4
  end
5
5
  end
@@ -251,6 +251,20 @@
251
251
  "type": "string"
252
252
  }
253
253
  }
254
+ },
255
+ "arrayOfObjects": {
256
+ "type": "array",
257
+ "items": {
258
+ "type": "object",
259
+ "properties": {
260
+ "name": {
261
+ "type": "string"
262
+ },
263
+ "age": {
264
+ "type": "integer"
265
+ }
266
+ }
267
+ }
254
268
  }
255
269
  }
256
270
  }
@@ -219,6 +219,18 @@ class PetV2
219
219
  key :type, :string
220
220
  end
221
221
  end
222
+ property :arrayOfObjects do
223
+ key :type, :array
224
+ items do
225
+ key :type, :object
226
+ property :name do
227
+ key :type, :string
228
+ end
229
+ property :age do
230
+ key :type, :integer
231
+ end
232
+ end
233
+ end
222
234
  end
223
235
  end
224
236
  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.1
4
+ version: 1.3.2
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-02-11 00:00:00.000000000 Z
11
+ date: 2016-03-07 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.2.2
113
+ rubygems_version: 2.4.5
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: Define and serve live-updating Swagger JSON for Ruby apps.
@@ -121,3 +121,4 @@ 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: