Skip to content

Commit ebbe731

Browse files
committedMar 30, 2017
Add a documentation directive for strings with jsonvalue traits
1 parent 81c17f8 commit ebbe731

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎doc-src/templates/api-versions/model_documentor.rb

+7-2
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,13 @@ def visit_map(node, required = false)
404404
end
405405

406406
def visit_string(node, required = false)
407-
value = node['enum'] ? node['enum'].join(' | ') : 'STRING_VALUE'
408-
"'#{value}'"
407+
if node['jsonvalue']
408+
"any /* This value will be JSON encoded on your behalf with JSON.stringify() */"
409+
elsif node['enum']
410+
node['enum'].join(' | ')
411+
else
412+
"'STRING_VALUE'"
413+
end
409414
end
410415

411416
def visit_integer(node, required = false)

0 commit comments

Comments
 (0)
Please sign in to comment.