grape-swagger-entity 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +6 -0
- data/lib/grape-swagger/entity/parser.rb +13 -5
- data/lib/grape-swagger/entity/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 719e50145ee34ef39de1daf50a3d495ff0221d07ee7688fea3df86c503e5de16
|
4
|
+
data.tar.gz: 3c470cba6e089f1e7ffa1b5139de981ee84f5d7d3e005a464d57c8b7f54a0e02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc20da740449366c3df92f5850ac36865cb4d0f0404a6cb2069e82cc94ceb71f2d32b5c3ba12d4a440676e8d053402a8e60de2ac8a62504e624c574ef126dac2
|
7
|
+
data.tar.gz: 7b281a8feeadbed1ff4651c92168783eaa6e7d3c5ae3e56970696c0096b7011f8a2e79d67b0cead55bab677f89788afde7ae1320ec5d5cc8ab5086416fefdd07
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,12 @@
|
|
8
8
|
|
9
9
|
* Your contribution here.
|
10
10
|
|
11
|
+
### 0.2.5 (April 26, 2018)
|
12
|
+
|
13
|
+
#### Features
|
14
|
+
|
15
|
+
* [#33](https://github.com/ruby-grape/grape-swagger-entity/pull/33): Update parser to respect merge option for entities - [@b-boogaard](https://github.com/b-boogaard).
|
16
|
+
|
11
17
|
### 0.2.4 (April 3, 2018)
|
12
18
|
|
13
19
|
#### Fixes
|
@@ -12,15 +12,23 @@ module GrapeSwagger
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call
|
15
|
-
|
16
|
-
memo[value.attribute] = value.send(:options)
|
17
|
-
end
|
18
|
-
|
19
|
-
parse_grape_entity_params(parameters)
|
15
|
+
parse_grape_entity_params(extract_params(model))
|
20
16
|
end
|
21
17
|
|
22
18
|
private
|
23
19
|
|
20
|
+
def extract_params(exposure)
|
21
|
+
exposure.root_exposures.each_with_object({}) do |value, memo|
|
22
|
+
if value.for_merge && (value.respond_to?(:entity_class) || value.respond_to?(:using_class_name))
|
23
|
+
entity_class = value.respond_to?(:entity_class) ? value.entity_class : value.using_class_name
|
24
|
+
|
25
|
+
memo.merge!(extract_params(entity_class))
|
26
|
+
else
|
27
|
+
memo[value.attribute] = value.send(:options)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
24
32
|
def parse_grape_entity_params(params, parent_model = nil)
|
25
33
|
return unless params
|
26
34
|
|
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.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kirill Zaitsev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape-entity
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
86
|
rubyforge_project:
|
87
|
-
rubygems_version: 2.
|
87
|
+
rubygems_version: 2.7.6
|
88
88
|
signing_key:
|
89
89
|
specification_version: 4
|
90
90
|
summary: Grape swagger adapter to support grape-entity object parsing
|