Skip to content

Commit d6ce378

Browse files
committed
Allow raw API Blueprint annotations for describing object attributes
1 parent f923315 commit d6ce378

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/rspec_api_documentation/views/api_blueprint_index.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def fields(property_name, examples)
8989
property[:has_default?] = true if property[:default]
9090
property[:has_enum?] = true if property[:enum]
9191

92+
property[:annotations] = property[:annotation].lines.map(&:chomp) if property[:annotation]
93+
9294
property[:description] = nil if description_blank?(property)
9395
property
9496
end

templates/rspec_api_documentation/api_blueprint_index.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ explanation: {{ explanation }}
4343
+ Attributes (object)
4444
{{# attributes }}
4545
+ {{ name }}{{# example }}: {{ example }}{{/ example }}{{# properties_description }} ({{ properties_description }}){{/ properties_description }}{{# description }} - {{ description }}{{/ description }}
46+
{{# annotations }}
47+
{{ . }}
48+
{{/ annotations }}
4649
{{/ attributes }}
4750
{{/ has_attributes? }}
4851
{{# http_methods }}

0 commit comments

Comments
 (0)