Files
openapi-generator/samples/documentation
madsvonqualen e868637587 [BUG] [HTML] Fix html array types (#22795)
* 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.

* Add html.yaml config and document testing requirements

Due to network limitations in the automated build environment, the
following steps could not be completed but are required per
contribution guidelines:

1. Build project: ./mvnw clean install -DskipTests
2. Regenerate samples: ./bin/generate-samples.sh bin/configs/html.yaml
3. Commit updated samples: git add samples/documentation/html/

Added:
- bin/configs/html.yaml: Configuration for html generator samples
- TESTING_STEPS.md: Detailed instructions for completing the PR

The template fix in bodyParam.mustache is complete and correct.
Sample regeneration is needed to verify the fix visually in the
generated HTML documentation.

* Add concrete example showing the bug location in current HTML sample

* Update HTML samples to verify array type fix

Regenerated samples/documentation/html/index.html to verify the array
type fix in bodyParam.mustache is working correctly.

Verified fix:
- Before: <div class="param">User <a href="#User">User</a> (required)</div>
- After:  <div class="param">User array[<a href="#User">User</a>] (required)</div>

The createUsersWithArrayInput endpoint (and all array body parameters)
now correctly displays "array[Type]" instead of just "Type".

Also removed TESTING_STEPS.md as testing is now complete.

* Update VERSION to 7.20.0-SNAPSHOT to match project version

The samples were regenerated using npm's openapi-generator-cli (v7.4.0),
but the CI expects the VERSION to match the current development version
(7.20.0-SNAPSHOT). Updated to prevent CI failures.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-24 23:27:16 +08:00
..
2023-05-16 14:32:52 +08:00
2026-01-20 03:13:58 +08:00
2021-09-09 12:09:38 +08:00