grape-swagger 0.25.1 → 0.25.2

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: 05e6839d574113d1a31a0b1758bb9426174b2dd5
4
- data.tar.gz: ad8936f7e557193a2502e95d64c8ef7c90a04684
3
+ metadata.gz: 152d9012cfd228b57f5bd894703832545865d0b7
4
+ data.tar.gz: d2fb99d11bb2c0329df1310fff779277c0b9c950
5
5
  SHA512:
6
- metadata.gz: c0ed0cbb32dbe1998964427703cee5e7399f67dad503ba1bd04569b913343bb67e5782da445340e4eda390a1f0c424edd08546a06189047de7d2f9ce3bc55463
7
- data.tar.gz: f01ba1a06247a146fed67950c98257d5708965531558f18468391da001e848aea03c2a80e3e19431337b10a2d912783ba8e50ed0fcedca3285ac7c637364d7ed
6
+ metadata.gz: 8bfede986d83fcd0bcbf29533872902269700906b81e35235efdf26f260fff8d79316192c579ca2248602bcc8abfef557a6df353d53fba03379616242b1f88ba
7
+ data.tar.gz: ae63ced69632be01f0f22944e0b261811bb14ea8c023ce7bed1556041d6bc1624d045d2beb1f3a73b347f2c019beb83b6f0cf316c446f2ef7a47f4ba98bf7552
@@ -9,6 +9,12 @@
9
9
  * Your contribution here.
10
10
 
11
11
 
12
+ ### 0.25.2 (November 30, 2016)
13
+
14
+ #### Fixes
15
+
16
+ * [#544](https://github.com/ruby-grape/grape-swagger/pull/544): Fixes #539 and #542; not all of 530 was commited - [@LeFnord](https://github.com/LeFnord).
17
+
12
18
  ### 0.25.1 (November 29, 2016)
13
19
 
14
20
  #### Features
@@ -28,6 +28,8 @@ module GrapeSwagger
28
28
 
29
29
  def correct_array_param(param)
30
30
  param.first[:schema] = { type: param.first.delete(:type), items: param.first.delete(:items) }
31
+
32
+ param
31
33
  end
32
34
 
33
35
  def parent_definition_of_params(params, route)
@@ -1,3 +1,3 @@
1
1
  module GrapeSwagger
2
- VERSION = '0.25.1'.freeze
2
+ VERSION = '0.25.2'.freeze
3
3
  end
@@ -2,10 +2,10 @@ require 'spec_helper'
2
2
  require 'grape-entity'
3
3
  require 'grape-swagger-entity'
4
4
 
5
- describe '#427 nested entity given as string' do
5
+ describe '#539 post params given as array' do
6
6
  let(:app) do
7
7
  Class.new(Grape::API) do
8
- namespace :issue_427 do
8
+ namespace :issue_539 do
9
9
  class Element < Grape::Entity
10
10
  expose :id
11
11
  expose :description
@@ -35,7 +35,7 @@ describe '#427 nested entity given as string' do
35
35
  JSON.parse(last_response.body)
36
36
  end
37
37
 
38
- let(:parameters) { subject['paths']['/issue_427']['post']['parameters'] }
38
+ let(:parameters) { subject['paths']['/issue_539']['post']['parameters'] }
39
39
  let(:definitions) { subject['definitions'] }
40
40
 
41
41
  specify do
@@ -48,7 +48,9 @@ describe '#427 nested entity given as string' do
48
48
  }
49
49
  ]
50
50
  )
51
+ end
51
52
 
53
+ specify do
52
54
  expect(definitions).to eql(
53
55
  'Element' => {
54
56
  'type' => 'object',
@@ -0,0 +1,46 @@
1
+ require 'spec_helper'
2
+ require 'grape-entity'
3
+ require 'grape-swagger-entity'
4
+
5
+ describe '#542 array of type in post params' do
6
+ let(:app) do
7
+ Class.new(Grape::API) do
8
+ namespace :issue_542 do
9
+ params do
10
+ requires :logs, type: Array[String], documentation: { param_type: 'body' }
11
+ end
12
+
13
+ post do
14
+ present params
15
+ end
16
+ end
17
+
18
+ add_swagger_documentation format: :json
19
+ end
20
+ end
21
+
22
+ subject do
23
+ get '/swagger_doc'
24
+ JSON.parse(last_response.body)
25
+ end
26
+
27
+ let(:parameters) { subject['paths']['/issue_542']['post']['parameters'] }
28
+
29
+ specify do
30
+ expect(parameters).to eql(
31
+ [
32
+ {
33
+ 'in' => 'body',
34
+ 'name' => 'logs',
35
+ 'required' => true,
36
+ 'schema' => {
37
+ 'type' => 'array',
38
+ 'items' => {
39
+ 'type' => 'string'
40
+ }
41
+ }
42
+ }
43
+ ]
44
+ )
45
+ end
46
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-swagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.1
4
+ version: 0.25.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Vandecasteele
@@ -262,7 +262,8 @@ files:
262
262
  - spec/issues/427_entity_as_string_spec.rb
263
263
  - spec/issues/430_entity_definitions_spec.rb
264
264
  - spec/issues/533_specify_status_code_spec.rb
265
- - spec/issues/539_array_post_body.rb
265
+ - spec/issues/539_array_post_body_spec.rb
266
+ - spec/issues/542_array_of_type_in_post_body_spec.rb
266
267
  - spec/lib/data_type_spec.rb
267
268
  - spec/lib/endpoint_spec.rb
268
269
  - spec/lib/extensions_spec.rb
@@ -361,7 +362,8 @@ test_files:
361
362
  - spec/issues/427_entity_as_string_spec.rb
362
363
  - spec/issues/430_entity_definitions_spec.rb
363
364
  - spec/issues/533_specify_status_code_spec.rb
364
- - spec/issues/539_array_post_body.rb
365
+ - spec/issues/539_array_post_body_spec.rb
366
+ - spec/issues/542_array_of_type_in_post_body_spec.rb
365
367
  - spec/lib/data_type_spec.rb
366
368
  - spec/lib/endpoint_spec.rb
367
369
  - spec/lib/extensions_spec.rb