rspec-openapi 0.3.7 → 0.3.8

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
  SHA256:
3
- metadata.gz: 31d1b980670f03ab900ae31ecd241ce6a2b44edfbbc79839c9dc948c22ffa6b0
4
- data.tar.gz: 51eead9afb87f8303cdb1d5b4fcb8331bfc01f534127c038be1394e6e598d9dc
3
+ metadata.gz: 0d269feb84050ecb4ccc68924f76ae57ff4404521c22dc6cc004a177a579138b
4
+ data.tar.gz: 7df64e4c1ec76e652039e952b66d10322d3fa56f9a8af125da7872bade8ae2ad
5
5
  SHA512:
6
- metadata.gz: ddd8900e0365e487f42411e3cbfc7a8c23d33cdd0376da9d705311e8ba7e5c8d95e97859a8b10e0e1b5f83da2e6a1e4166993adc6a8dddb704cc3949a02eae7a
7
- data.tar.gz: 3bd25b3e5d2ce70c0961d3bcd471d0c6ff6d36e5bc2a7d72fd43f594f698a56a38774bc0d298a936987db54eca6995f098817adbabf232433dc4f2f26232f4f9
6
+ metadata.gz: bbb3af75f12db96f24941fb6f14112fa860ff98a23b44fecb9a2efb87974dfdb68d11afa113cedea15761dd59b33a621357a1e829613c61235338bf436d09965
7
+ data.tar.gz: 552c01a691716245c43c186cc913e26578d287c54e005633901da94e286694e1b83f47a0a438aebd18a0b6b8a1b6d7cb3dd1afe21faef87dae3765613ebef57f
@@ -1,3 +1,8 @@
1
+ ## v0.3.8
2
+
3
+ * Generate `type: 'number', format: 'float'` instead of `type: 'float'` for Float
4
+ [#11](https://github.com/k0kubun/rspec-openapi/issues/11)
5
+
1
6
  ## v0.3.7
2
7
 
3
8
  * Classify tag names and remove controller names from summary in Rails
@@ -79,7 +79,8 @@ class << RSpec::OpenAPI::SchemaBuilder = Object.new
79
79
  end
80
80
 
81
81
  def build_property(value)
82
- property = { type: build_type(value) }
82
+ property = build_type(value)
83
+
83
84
  case value
84
85
  when Array
85
86
  property[:items] = build_property(value.first)
@@ -96,19 +97,19 @@ class << RSpec::OpenAPI::SchemaBuilder = Object.new
96
97
  def build_type(value)
97
98
  case value
98
99
  when String
99
- 'string'
100
- when Float
101
- 'float'
100
+ { type: 'string' }
102
101
  when Integer
103
- 'integer'
102
+ { type: 'integer' }
103
+ when Float
104
+ { type: 'number', format: 'float' }
104
105
  when TrueClass, FalseClass
105
- 'boolean'
106
+ { type: 'boolean' }
106
107
  when Array
107
- 'array'
108
+ { type: 'array' }
108
109
  when Hash
109
- 'object'
110
+ { type: 'object' }
110
111
  when NilClass
111
- 'null'
112
+ { type: 'null' }
112
113
  else
113
114
  raise NotImplementedError, "type detection is not implemented for: #{value.inspect}"
114
115
  end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module OpenAPI
3
- VERSION = '0.3.7'
3
+ VERSION = '0.3.8'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-openapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-23 00:00:00.000000000 Z
11
+ date: 2020-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -73,7 +73,7 @@ metadata:
73
73
  homepage_uri: https://github.com/k0kubun/rspec-openapi
74
74
  source_code_uri: https://github.com/k0kubun/rspec-openapi
75
75
  changelog_uri: https://github.com/k0kubun/rspec-openapi/blob/master/CHANGELOG.md
76
- post_install_message:
76
+ post_install_message:
77
77
  rdoc_options: []
78
78
  require_paths:
79
79
  - lib
@@ -88,8 +88,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  requirements: []
91
- rubygems_version: 3.1.2
92
- signing_key:
91
+ rubygems_version: 3.1.4
92
+ signing_key:
93
93
  specification_version: 4
94
94
  summary: Generate OpenAPI schema from RSpec request specs
95
95
  test_files: []