grape-swagger-entity 0.3.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/CHANGELOG.md +12 -1
- data/README.md +1 -1
- data/grape-swagger-entity.gemspec +1 -1
- data/lib/grape-swagger/entity/attribute_parser.rb +12 -5
- data/lib/grape-swagger/entity/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cbc9a4f5350f907024319ec60d6bebcf58c1d9a9fbe0a87157eb521f5d90c27
|
4
|
+
data.tar.gz: d70650e560a98a5c8e6299136146796d87bb8e124944c2b09603ddcab415085a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fffce9cc2ae49583807c9e02a5ed6d0c6fdbd1e3acc2f4816868b292fb8ae0e77161bd4736dcb2d91e30633a814cd8fd31c2f21af9fec12cc4cec8243bb5ce1
|
7
|
+
data.tar.gz: 2c5cdf2184fefbd92fda6b7f65d95d31f0c331e225be2439b5fa2f6d711a7754890271b7a41b06cdd36c44d3bcace9b836cd727c93b21892e6ae9651badb712a
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,10 +4,21 @@
|
|
4
4
|
|
5
5
|
* Your contribution here.
|
6
6
|
|
7
|
-
####
|
7
|
+
#### Features
|
8
8
|
|
9
9
|
* Your contribution here.
|
10
10
|
|
11
|
+
### 0.4.0 (May 30, 2020)
|
12
|
+
|
13
|
+
#### Features
|
14
|
+
|
15
|
+
* [#49](https://github.com/ruby-grape/grape-swagger-entity/pull/49): Bumped minimal required version of grape-swagger to 1.0.0 - [@Bugagazavr](https://github.com/Bugagazavr).
|
16
|
+
* [#48](https://github.com/ruby-grape/grape-swagger-entity/pull/48): Add support for extensions - [@MaximeRDY](https://github.com/MaximeRDY).
|
17
|
+
|
18
|
+
#### Fixes
|
19
|
+
|
20
|
+
* [#46](https://github.com/ruby-grape/grape-swagger-entity/pull/46): Fixed issue where a boolean example value of false would not display in swagger file - [@drewnichols](https://github.com/drewnichols).
|
21
|
+
|
11
22
|
### 0.3.4 (January 9, 2020)
|
12
23
|
|
13
24
|
#### Features
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
26
26
|
|
27
27
|
## Contributing
|
28
28
|
|
29
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
29
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby-grape/grape-swagger-entity.
|
30
30
|
|
31
31
|
## License
|
32
32
|
|
@@ -24,8 +24,8 @@ module GrapeSwagger
|
|
24
24
|
param = data_type_from(entity_options)
|
25
25
|
return param unless documentation
|
26
26
|
|
27
|
-
param
|
28
|
-
|
27
|
+
add_attribute_sample(param, documentation, :default)
|
28
|
+
add_attribute_sample(param, documentation, :example)
|
29
29
|
|
30
30
|
if (values = documentation[:values])
|
31
31
|
param[:enum] = values if values.is_a?(Array)
|
@@ -38,6 +38,8 @@ module GrapeSwagger
|
|
38
38
|
|
39
39
|
add_attribute_documentation(param, documentation)
|
40
40
|
|
41
|
+
add_extension_documentation(param, documentation)
|
42
|
+
|
41
43
|
param
|
42
44
|
end
|
43
45
|
end
|
@@ -105,10 +107,11 @@ module GrapeSwagger
|
|
105
107
|
end
|
106
108
|
end
|
107
109
|
|
108
|
-
def
|
109
|
-
|
110
|
+
def add_attribute_sample(attribute, hash, key)
|
111
|
+
value = hash[key]
|
112
|
+
return if value.nil?
|
110
113
|
|
111
|
-
attribute[
|
114
|
+
attribute[key] = value.is_a?(Proc) ? value.call : value
|
112
115
|
end
|
113
116
|
|
114
117
|
def add_attribute_documentation(param, documentation)
|
@@ -121,6 +124,10 @@ module GrapeSwagger
|
|
121
124
|
param[:maxItems] = documentation[:max_items] if documentation.key?(:max_items)
|
122
125
|
param[:uniqueItems] = documentation[:unique_items] if documentation.key?(:unique_items)
|
123
126
|
end
|
127
|
+
|
128
|
+
def add_extension_documentation(param, documentation)
|
129
|
+
GrapeSwagger::DocMethods::Extensions.add_extensions_to_root(documentation, param)
|
130
|
+
end
|
124
131
|
end
|
125
132
|
end
|
126
133
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-swagger-entity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Zaitsev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape-entity
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 1.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 1.0.0
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- kirik910@gmail.com
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
rubygems_version: 3.0.
|
86
|
+
rubygems_version: 3.0.3
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Grape swagger adapter to support grape-entity object parsing
|