Skip to content

Commit 343865c

Browse files
committed
Fix HTML generator to display array types for body parameters
The HTML generator (htmlDocs) was not properly displaying array types for request body parameters. When an endpoint accepted an array of objects as input, only the base type was shown (e.g., "User") instead of the full array type (e.g., "array[User]"). This fix updates the bodyParam.mustache template to include container type information (array, map, etc.) when present, matching the format already used for return types. Before: User After: array[User] The fix wraps the baseType with containerType[...] when isContainer is true, ensuring consistent type display across both input and output types in the generated HTML documentation.
1 parent cc045ab commit 343865c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{{#isBodyParam}}<div class="param">{{baseName}} {{#baseType}}<a href="#{{baseType}}">{{baseType}}</a>{{/baseType}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}</div>
1+
{{#isBodyParam}}<div class="param">{{baseName}} {{#isContainer}}{{containerType}}[{{/isContainer}}{{#baseType}}<a href="#{{baseType}}">{{baseType}}</a>{{/baseType}}{{#isContainer}}]{{/isContainer}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}</div>
22

33
<div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; {{unescapedDescription}} {{#defaultValue}}default: {{{.}}}{{/defaultValue}}</div>{{/isBodyParam}}

0 commit comments

Comments
 (0)