dry-swagger 0.5.0 → 0.5.1

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
  SHA256:
3
- metadata.gz: 5179183ed4122bcf5042f8aa812b6830b1126ae00d4eb2975bd17203af2bf375
4
- data.tar.gz: 9eb614eaaaca4752a39f9a77ef2fac3dffb4df2179a0c7e7f427d13f9f02333e
3
+ metadata.gz: 3b612143bf3038b32981bae55874524220f769bfe7db95ee1fc2be928f563f73
4
+ data.tar.gz: 02e71a27f38fafae4f6db24d267157467dbe1889649caf036b3eddafa8b7ef27
5
5
  SHA512:
6
- metadata.gz: 58dea258473d5fea4c521d699a2332ec8a444d15504b81ff3eefba0ef50c08371fe5d9b3fd7e2d3331613375f625bdb3ea54073dde31cfc20eafdc0d29e49202
7
- data.tar.gz: 2ec6862a8021cb836101cac89b394482507a6b48021cfbf304b63c8753fe0bcefb822730a194ae869da6c83dc34e965af771a58b6052dc729cea0d528a97b6a4
6
+ metadata.gz: 9c3da6167caaf0f60a5d4b6f07aa00b1c964c19c8b8cc7508c7d59a3e266a34c5f54c66644030a3048e2713092ca164f4d1f82315a09a8989bfc702486bc05d8
7
+ data.tar.gz: 10c946ec34aef062dccccfedfa6fe6fb8b6ba9cfb09d0a434d7cf22d879a60177632f28c082b0dd81091cccf66204b4ded6526888b60b37234c8b8a288af0bc7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dry-swagger (0.5.0)
4
+ dry-swagger (0.5.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -40,12 +40,25 @@ module Dry
40
40
  attributes_hash.each_with_index do |_, index|
41
41
  properties["definition_#{index + 1}"] = generate_field_properties(attributes_hash[index])
42
42
  end
43
- {
44
- oneOf: attributes_hash.map{ |it| generate_field_properties(it) },
45
- type: :object,
46
- properties: properties,
47
- example: 'Dynamic Field. See Model Definitions'
48
- }
43
+ if attributes_hash[0][:type] == 'array'
44
+ attributes_hash.each { |definition| definition[:type] = 'hash'}
45
+ {
46
+ type: :array,
47
+ items: {
48
+ type: :object,
49
+ properties: properties,
50
+ oneOf: attributes_hash.map{ |it| generate_field_properties(it) },
51
+ example: 'Dynamic Field. See Model Definitions'
52
+ },
53
+ }
54
+ else
55
+ {
56
+ oneOf: attributes_hash.map{ |it| generate_field_properties(it) },
57
+ type: :object,
58
+ properties: properties,
59
+ example: 'Dynamic Field. See Model Definitions'
60
+ }
61
+ end
49
62
  else
50
63
  if attributes_hash[:type] == 'array'
51
64
  items = generate_documentation(attributes_hash.fetch(:keys))
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module Swagger
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-swagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jane-Terziev