Skip to content

Commit f923315

Browse files
committed
Add parameter defaults and enums to API Blueprint
1 parent 6a4a173 commit f923315

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/rspec_api_documentation/views/api_blueprint_index.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ def fields(property_name, examples)
8686
property[:properties_description] = nil
8787
end
8888

89+
property[:has_default?] = true if property[:default]
90+
property[:has_enum?] = true if property[:enum]
91+
8992
property[:description] = nil if description_blank?(property)
9093
property
9194
end

templates/rspec_api_documentation/api_blueprint_index.mustache

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ explanation: {{ explanation }}
2727
+ Parameters
2828
{{# parameters }}
2929
+ {{ name }}{{# example }}: {{ example }}{{/ example }}{{# properties_description }} ({{ properties_description }}){{/ properties_description }}{{# description }} - {{ description }}{{/ description }}
30+
{{# has_default?}}
31+
+ Default: `{{default}}`
32+
{{/ has_default?}}
33+
{{# has_enum?}}
34+
+ Members
35+
{{# enum}}
36+
+ `{{.}}`
37+
{{/ enum}}
38+
{{/ has_enum?}}
3039
{{/ parameters }}
3140
{{/ has_parameters? }}
3241
{{# has_attributes? }}

0 commit comments

Comments
 (0)