File tree 2 files changed +17
-16
lines changed
lib/rspec_api_documentation/views
templates/rspec_api_documentation
2 files changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -10,23 +10,24 @@ def sections
10
10
super . map do |section |
11
11
routes = section [ :examples ] . group_by { |e | "#{ e . route_uri } #{ e . route_optionals } #{ e . route_name } " } . map do |route , examples |
12
12
attrs = fields ( :attributes , examples )
13
- params = fields ( :parameters , examples )
14
13
15
14
methods = examples . group_by ( &:http_method ) . map do |http_method , examples |
15
+ params = fields ( :parameters , examples )
16
+
16
17
{
18
+ "has_parameters?" . to_sym => params . size > 0 ,
17
19
http_method : http_method ,
20
+ parameters : params ,
18
21
description : examples . first . respond_to? ( :action_name ) && examples . first . action_name ,
19
22
examples : examples
20
23
}
21
24
end
22
25
23
26
{
24
27
"has_attributes?" . to_sym => attrs . size > 0 ,
25
- "has_parameters?" . to_sym => params . size > 0 ,
26
28
route : format_route ( examples [ 0 ] ) ,
27
29
route_name : examples [ 0 ] [ :route_name ] ,
28
30
attributes : attrs ,
29
- parameters : params ,
30
31
http_methods : methods
31
32
}
32
33
end
Original file line number Diff line number Diff line change @@ -23,10 +23,10 @@ description: {{ description }}
23
23
24
24
explanation: { { explanation } }
25
25
{ {/ explanation } }
26
- { {# has_parameters ? } }
26
+ { {# has_attributes ? } }
27
27
28
- + Parameters
29
- { {# parameters } }
28
+ + Attributes (object)
29
+ { {# attributes } }
30
30
+ { { name } }{ {# example } }: { { example } }{ {/ example } }{ {# properties_description } } ({ { properties_description } }){ {/ properties_description } }{ {# description } } - { { description } }{ {/ description } }
31
31
{ {# has_default?} }
32
32
+ Default: `{ {default } }`
@@ -40,12 +40,15 @@ explanation: {{ explanation }}
40
40
{ {# annotations } }
41
41
{ { . } }
42
42
{ {/ annotations } }
43
- { {/ parameters } }
44
- { {/ has_parameters ? } }
45
- { {# has_attributes? } }
43
+ { {/ attributes } }
44
+ { {/ has_attributes ? } }
45
+ { {# http_methods } }
46
46
47
- + Attributes (object)
48
- { {# attributes } }
47
+ ### { { description } } [{ { http_method } }]
48
+ { {# has_parameters? } }
49
+
50
+ + Parameters
51
+ { {# parameters } }
49
52
+ { { name } }{ {# example } }: { { example } }{ {/ example } }{ {# properties_description } } ({ { properties_description } }){ {/ properties_description } }{ {# description } } - { { description } }{ {/ description } }
50
53
{ {# has_default?} }
51
54
+ Default: `{ {default } }`
@@ -59,11 +62,8 @@ explanation: {{ explanation }}
59
62
{ {# annotations } }
60
63
{ { . } }
61
64
{ {/ annotations } }
62
- { {/ attributes } }
63
- { {/ has_attributes? } }
64
- { {# http_methods } }
65
-
66
- ### { { description } } [{ { http_method } }]
65
+ { {/ parameters } }
66
+ { {/ has_parameters? } }
67
67
{ {# examples } }
68
68
{ {# requests } }
69
69
{ {# has_request? } }
You can’t perform that action at this time.
0 commit comments