Skip to content

Commit 9890bfc

Browse files
committed
Some documentation flags
1 parent dcdae69 commit 9890bfc

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

.rubocop_todo.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2016-05-07 20:24:20 +0300 using RuboCop version 0.39.0.
3+
# on 2016-05-08 06:18:31 +0300 using RuboCop version 0.39.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 1
9+
# Offense count: 2
1010
Metrics/AbcSize:
11-
Max: 29
11+
Max: 30
1212

1313
# Offense count: 2
1414
Metrics/CyclomaticComplexity:
15-
Max: 10
15+
Max: 11
1616

17-
# Offense count: 69
17+
# Offense count: 65
1818
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
1919
# URISchemes: http, https
2020
Metrics/LineLength:
@@ -27,7 +27,7 @@ Metrics/MethodLength:
2727

2828
# Offense count: 2
2929
Metrics/PerceivedComplexity:
30-
Max: 13
30+
Max: 14
3131

3232
# Offense count: 2
3333
Style/Documentation:

lib/grape-swagger/representable/parser.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def parse_representer_property(property)
4141

4242
memo[:enum] = documentation[:values] if documentation[:values].is_a?(Array)
4343

44-
if is_a_collection
44+
if is_a_collection || documentation[:is_array]
4545
memo = {
4646
type: :array,
4747
items: memo
@@ -56,7 +56,7 @@ def representer_mapping(representer, documentation, is_a_collection = false, is_
5656
if nested.nil? && is_a_decorator
5757
name = endpoint.send(:expose_params_from_model, representer)
5858

59-
if is_a_collection
59+
if is_a_collection || documentation[:is_array]
6060
{
6161
type: :array,
6262
items: {
@@ -79,9 +79,9 @@ def representer_mapping(representer, documentation, is_a_collection = false, is_
7979
type: :array,
8080
items: {
8181
type: :object,
82-
properties: attributes,
83-
description: documentation[:desc] || ''
84-
}
82+
properties: attributes
83+
},
84+
description: documentation[:desc] || ''
8585
}
8686
else
8787
{

spec/grape-swagger/representers/response_inline_representer_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ def app
135135
'properties' => {
136136
'name' => { 'description' => 'Name', 'type' => 'string' },
137137
'color' => { 'description' => 'Tag color.', 'type' => 'string' }
138-
},
139-
'description' => 'Tags.'
140-
}
138+
}
139+
},
140+
'description' => 'Tags.'
141141
}
142142
}
143143
)

0 commit comments

Comments
 (0)