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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dry/swagger/documentation_generator.rb +19 -6
- data/lib/dry/swagger/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b612143bf3038b32981bae55874524220f769bfe7db95ee1fc2be928f563f73
|
4
|
+
data.tar.gz: 02e71a27f38fafae4f6db24d267157467dbe1889649caf036b3eddafa8b7ef27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c3da6167caaf0f60a5d4b6f07aa00b1c964c19c8b8cc7508c7d59a3e266a34c5f54c66644030a3048e2713092ca164f4d1f82315a09a8989bfc702486bc05d8
|
7
|
+
data.tar.gz: 10c946ec34aef062dccccfedfa6fe6fb8b6ba9cfb09d0a434d7cf22d879a60177632f28c082b0dd81091cccf66204b4ded6526888b60b37234c8b8a288af0bc7
|
data/Gemfile.lock
CHANGED
@@ -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
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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))
|
data/lib/dry/swagger/version.rb
CHANGED