rspec-openapi 0.3.10 → 0.3.11

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: 62ae9fb333bba34df56a7675823e22ae9029852028d529ffae48ee9070eadeb0
4
- data.tar.gz: 249959214fbce6ae72294f07e1a7de945c1052071d67942ec7f19c68cbe90a9f
3
+ metadata.gz: 07e405e19fc7324fbfb0c67f18643ef3a924441f75971920e29dcb074c5fee41
4
+ data.tar.gz: 55ed7e046ef1dccb8e51d5d9d04012f32007a22da8d20217a582e14112eadc64
5
5
  SHA512:
6
- metadata.gz: 8f66917401fc326b7a290892000ef82af637d959fd337ab158152176605fa5e41a8ce2e904b7c1d73cef203d1b3851912bcff0d58f5e879d27fc728f456d1569
7
- data.tar.gz: abf3aee3cd216b58d53079c53372a3839c3cc89470d5a0500274fde35a3103643d8c6a3555b977989bc598f4f71e0518300cec76372dce1a8ff4bb41615a0113
6
+ metadata.gz: d8784246f9827274f9a16ad7e70201f0470a63c9568109ae8e5f02a6a154a02829d6ae8e34d6e4b767ec92afa470a3b72be2bf32dcb2c51b6a628b0fdfa3c8fe
7
+ data.tar.gz: b690fb8885f58626825f072cd75e740649faa05e1b398bf26480a2b8b6013f51f0596c177c92ed57c23fa7c5e49d92d3110c6af406c17bf0f570a8fdcc50f272
@@ -19,6 +19,7 @@ jobs:
19
19
  - ruby:2.5
20
20
  - ruby:2.6
21
21
  - ruby:2.7
22
+ - ruby:3.0
22
23
  steps:
23
24
  - uses: actions/checkout@v2
24
25
  - name: bundle install
@@ -1,3 +1,8 @@
1
+ ## v0.3.11
2
+
3
+ * Show a filename as an `example` for `ActionDispatch::Http::UploadedFile`
4
+ [#17](https://github.com/k0kubun/rspec-openapi/pull/17)
5
+
1
6
  ## v0.3.10
2
7
 
3
8
  * Add `info.version`
@@ -72,7 +72,7 @@ class << RSpec::OpenAPI::SchemaBuilder = Object.new
72
72
  content: {
73
73
  normalize_content_type(record.request_content_type) => {
74
74
  schema: build_property(record.request_params),
75
- example: (record.request_params if example_enabled?),
75
+ example: (build_example(record.request_params) if example_enabled?),
76
76
  }.compact
77
77
  }
78
78
  }
@@ -126,6 +126,16 @@ class << RSpec::OpenAPI::SchemaBuilder = Object.new
126
126
  end
127
127
  end
128
128
 
129
+ def build_example(value)
130
+ return nil if value.nil?
131
+ value = value.dup
132
+ value.each do |key, v|
133
+ if v.is_a?(ActionDispatch::Http::UploadedFile)
134
+ value[key] = v.original_filename
135
+ end
136
+ end
137
+ end
138
+
129
139
  def normalize_path(path)
130
140
  path.gsub(%r|/:([^:/]+)|, '/{\1}')
131
141
  end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module OpenAPI
3
- VERSION = '0.3.10'
3
+ VERSION = '0.3.11'
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.10
4
+ version: 0.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-12 00:00:00.000000000 Z
11
+ date: 2021-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  requirements: []
92
- rubygems_version: 3.1.2
92
+ rubygems_version: 3.2.6
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: Generate OpenAPI schema from RSpec request specs