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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 229df240d0c267af65e856319d3841ccb52c1fed
4
- data.tar.gz: 2fb820079fb37401469d32f4f9bd605096ac3754
2
+ SHA256:
3
+ metadata.gz: 719e50145ee34ef39de1daf50a3d495ff0221d07ee7688fea3df86c503e5de16
4
+ data.tar.gz: 3c470cba6e089f1e7ffa1b5139de981ee84f5d7d3e005a464d57c8b7f54a0e02
5
5
  SHA512:
6
- metadata.gz: fde61dee3fdb8d2d180511d04d63f740bcdfb50c4ecd6f32ff4714ac09829259be2af375955a914a37423ea35023b8bfc79b79b1695db9ebb073401e9500536c
7
- data.tar.gz: 3f462c64b9d539a1246ffbb32238bcc86c7f6e6f5ee5c448e15c7b02a584c917751de574045026ac5ad9ba80d5c9104a878c333d785f6cc3497b69ae51402a35
6
+ metadata.gz: fc20da740449366c3df92f5850ac36865cb4d0f0404a6cb2069e82cc94ceb71f2d32b5c3ba12d4a440676e8d053402a8e60de2ac8a62504e624c574ef126dac2
7
+ data.tar.gz: 7b281a8feeadbed1ff4651c92168783eaa6e7d3c5ae3e56970696c0096b7011f8a2e79d67b0cead55bab677f89788afde7ae1320ec5d5cc8ab5086416fefdd07
@@ -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
- parameters = model.root_exposures.each_with_object({}) do |value, memo|
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
 
@@ -1,5 +1,5 @@
1
1
  module GrapeSwagger
2
2
  module Entity
3
- VERSION = '0.2.4'.freeze
3
+ VERSION = '0.2.5'.freeze
4
4
  end
5
5
  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.2.4
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-03 00:00:00.000000000 Z
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.5.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