grape-swagger-entity 0.2.3 → 0.2.4

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
  SHA1:
3
- metadata.gz: dc998b981e77b49cc07ee0c8556ae90cd9039e7f
4
- data.tar.gz: b41b339f7804f2b95234a72da9db8d8545a54e78
3
+ metadata.gz: 229df240d0c267af65e856319d3841ccb52c1fed
4
+ data.tar.gz: 2fb820079fb37401469d32f4f9bd605096ac3754
5
5
  SHA512:
6
- metadata.gz: 040cebbf6a2a1a884d2a767655c61c4255d298a5e78212131a8fd70e576f332480cb5e4417660162e8cfabebf63abad6e265f166a330a1b2e7228ce33113abbf
7
- data.tar.gz: 304e5f306ab9e0cfd43fb293c0604d88db110790ab6aa262d50ce27dafa9e320695bcb9a55083d5b734578b2f7e9273f28375bd0195ae91ca6bc957fe2764aa8
6
+ metadata.gz: fde61dee3fdb8d2d180511d04d63f740bcdfb50c4ecd6f32ff4714ac09829259be2af375955a914a37423ea35023b8bfc79b79b1695db9ebb073401e9500536c
7
+ data.tar.gz: 3f462c64b9d539a1246ffbb32238bcc86c7f6e6f5ee5c448e15c7b02a584c917751de574045026ac5ad9ba80d5c9104a878c333d785f6cc3497b69ae51402a35
data/.rubocop.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  AllCops:
2
2
  Exclude:
3
3
  - vendor/**/*
4
+ TargetRubyVersion:
5
+ 2.2
4
6
 
5
7
  inherit_from: .rubocop_todo.yml
6
8
 
data/CHANGELOG.md CHANGED
@@ -8,6 +8,12 @@
8
8
 
9
9
  * Your contribution here.
10
10
 
11
+ ### 0.2.4 (April 3, 2018)
12
+
13
+ #### Fixes
14
+
15
+ * [#32](https://github.com/ruby-grape/grape-swagger-entity/pull/32): Fix issue with read_only fields - [@mcfilib](https://github.com/mcfilib).
16
+
11
17
  ### 0.2.3 (November 19, 2017)
12
18
 
13
19
  #### Fixes
@@ -1,4 +1,4 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'grape-swagger/entity/version'
4
4
 
@@ -35,9 +35,7 @@ module GrapeSwagger
35
35
  def model_from(entity_options)
36
36
  model = entity_options[:using] if entity_options[:using].present?
37
37
 
38
- if could_it_be_a_model?(entity_options[:documentation])
39
- model ||= entity_options[:documentation][:type]
40
- end
38
+ model ||= entity_options[:documentation][:type] if could_it_be_a_model?(entity_options[:documentation])
41
39
 
42
40
  model
43
41
  end
@@ -37,9 +37,7 @@ module GrapeSwagger
37
37
  end
38
38
 
39
39
  next unless documentation
40
- if documentation[:read_only]
41
- memo[final_entity_name][:read_only] = documentation[:read_only].to_s == 'true'
42
- end
40
+ memo[final_entity_name][:readOnly] = documentation[:read_only].to_s == 'true' if documentation[:read_only]
43
41
  memo[final_entity_name][:description] = documentation[:desc] if documentation[:desc]
44
42
  end
45
43
  end
@@ -1,5 +1,5 @@
1
1
  module GrapeSwagger
2
2
  module Entity
3
- VERSION = '0.2.3'.freeze
3
+ VERSION = '0.2.4'.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.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kirill Zaitsev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-19 00:00:00.000000000 Z
11
+ date: 2018-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape-entity