rspec-rails-api 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -2
- data/lib/rspec/rails/api/metadata.rb +3 -3
- data/lib/rspec/rails/api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca1fda3905c2dd0831009c51f1cf41aa75538aed6f635b87cb12828e5db69476
|
4
|
+
data.tar.gz: e965376d3c9c53a55537333f55b9c6165d23335f78b8ca4d030fa815dae0791b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85a1a31174c7c674ccadcef0481dd249c7169f41e0aa8c3a52f1f542970948ca9e4a885900384871c2245e9b5c968d4f798e6d2d0b6e4284906c26bbd12c33ca
|
7
|
+
data.tar.gz: cb7d32f0db0d82961d2f43647c6b65d6000e4a6605e9439806d3534ad7dccd79122a9659c06c5f71bf737849260a2488afb978bde83f3675587dfb9ec0b0a131
|
data/README.md
CHANGED
@@ -241,7 +241,7 @@ Defines the path parameters that are used in the URL.
|
|
241
241
|
on_get '/api/users/:id/posts/:post_slug?full=:full_post' do
|
242
242
|
path_params id: type: :integer, description: 'The user ID',
|
243
243
|
post_slug: type: :string, description: 'The post slug',
|
244
|
-
full_post: type: :boolean, required: false, description: 'Returns the full post if `true`, or only an excerpt'
|
244
|
+
full_post: type: :boolean, required: false, description: 'Returns the full post if `true`, or only an excerpt'
|
245
245
|
|
246
246
|
# ...
|
247
247
|
end
|
@@ -271,7 +271,7 @@ end
|
|
271
271
|
An attribute should have the following form:
|
272
272
|
|
273
273
|
```
|
274
|
-
<attr_name>: {type: <type>, desc: <description>, required: <required>, properties: <another_hash> }
|
274
|
+
<attr_name>: {type: <type>, desc: <description>, required: <required>, properties: <another_hash>, of: <another_hash> }
|
275
275
|
```
|
276
276
|
|
277
277
|
- `attr_name` is the attribute name (sic)
|
@@ -279,6 +279,7 @@ An attribute should have the following form:
|
|
279
279
|
`type` can be `:object` if the attribute contains other attributes.
|
280
280
|
- `required` is optional an defaults to `false`.
|
281
281
|
- `properties` is a hash of params and is only used if `type: :object`
|
282
|
+
- `of` is a hash of params and is only used if `type: :array`
|
282
283
|
|
283
284
|
##### `for_code(http_status, description, doc_only: false &block)`
|
284
285
|
|
@@ -163,15 +163,15 @@ module RSpec
|
|
163
163
|
end
|
164
164
|
|
165
165
|
def fill_request_param(field)
|
166
|
-
if field[:type] && field[:
|
167
|
-
organize_params field[:properties]
|
166
|
+
if field[:type] == :object && field[:properties]
|
167
|
+
organize_params field[:properties]
|
168
168
|
else
|
169
169
|
properties = {
|
170
170
|
type: field[:type].to_s,
|
171
171
|
description: field[:description] || nil,
|
172
172
|
}
|
173
173
|
|
174
|
-
properties[:items] =
|
174
|
+
properties[:items] = organize_params field[:of] if field[:type] == :array && field[:of]
|
175
175
|
properties
|
176
176
|
end
|
177
177
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-rails-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manuel Tancoigne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|