grape-swagger-representable 0.2.0 → 0.2.1

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: 16bed46317a7ff343cc6c63c61b53ed61e569b34
4
- data.tar.gz: b65dd960b7ea15d0daa0ab3a1efcee5baa03e792
3
+ metadata.gz: f7843f1d937795abb96b6f88ffdf594f814679a1
4
+ data.tar.gz: bc4baf2779a918e43fbaf5bafc7da590d4731291
5
5
  SHA512:
6
- metadata.gz: 5d9c600e84a70795644fa23e80a7a620d77da1490bda16b7f858f1bc14355779163e821846e3459c768101fc99459b6c1317fe4d2956d463cdca7f3760edf9f2
7
- data.tar.gz: 37d417d8eaf1a7a57a397095d2d4978f4a11a369734d566263c4efb689b80492a5ecab2392dfeb7716532913916e36c5201aa971ec72af19ca31f29f2bd14b44
6
+ metadata.gz: 3b5f4e1a40b85663454abf5bb246d7d8e5f89719264f87ddc8c63b6ef1bb8dce8433ed05f225eb640f7ec8291f851571496ba7d0ad7f44af026f8ca3056f4d51
7
+ data.tar.gz: 1ec6c429f2390e8d3f4028a38e064ffbac3190c31a8cb376b49d11e36817671baa93ea69212baa4fac44a6089afd1b94f8a06fe290fa5d732b646e837e2e6398
@@ -41,8 +41,11 @@ module GrapeSwagger
41
41
  memo[:type] = data_type
42
42
  end
43
43
 
44
+ default_value = documentation[:default] || property[:default] || nil
45
+ memo[:default] = default_value unless default_value.nil?
46
+
44
47
  values = documentation[:values] || property[:values] || nil
45
- memo[:enum] = values if values.is_a?(Array)
48
+ memo[:enum] = values.is_a?(Proc) ? values.call : values if values
46
49
 
47
50
  example = documentation[:example] || property[:example] || nil
48
51
  memo[:example] = example.is_a?(Proc) ? example.call : example if example
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GrapeSwagger
4
4
  module Representable
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-swagger-representable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
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-08-22 00:00:00.000000000 Z
11
+ date: 2018-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape-swagger