|
| 1 | +# Testing Steps Required for HTML Generator Fix |
| 2 | + |
| 3 | +This document outlines the steps that need to be completed to finalize the HTML generator array type fix according to the contribution guidelines. |
| 4 | + |
| 5 | +## What Was Fixed |
| 6 | + |
| 7 | +Fixed the `bodyParam.mustache` template in `/modules/openapi-generator/src/main/resources/htmlDocs/` to properly display array types for request body parameters. |
| 8 | + |
| 9 | +**Before:** `User` |
| 10 | +**After:** `array[User]` |
| 11 | + |
| 12 | +## Steps to Complete (Due to Build Environment Limitations) |
| 13 | + |
| 14 | +The following steps could not be completed in the automated environment due to network restrictions preventing Maven from downloading dependencies: |
| 15 | + |
| 16 | +### 1. Build the Project |
| 17 | + |
| 18 | +```bash |
| 19 | +./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true |
| 20 | +``` |
| 21 | + |
| 22 | +This generates the `openapi-generator-cli.jar` needed for sample generation. |
| 23 | + |
| 24 | +### 2. Create HTML Generator Config (Already Done) |
| 25 | + |
| 26 | +Created `/bin/configs/html.yaml` with: |
| 27 | +```yaml |
| 28 | +generatorName: html |
| 29 | +outputDir: samples/documentation/html |
| 30 | +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml |
| 31 | +templateDir: modules/openapi-generator/src/main/resources/htmlDocs |
| 32 | +additionalProperties: |
| 33 | + hideGenerationTimestamp: "true" |
| 34 | +``` |
| 35 | +
|
| 36 | +### 3. Regenerate HTML Samples |
| 37 | +
|
| 38 | +```bash |
| 39 | +./bin/generate-samples.sh bin/configs/html.yaml |
| 40 | +``` |
| 41 | + |
| 42 | +This will update `/samples/documentation/html/index.html` with the fix. |
| 43 | + |
| 44 | +### 4. Verify the Fix |
| 45 | + |
| 46 | +Check that in `samples/documentation/html/index.html`, the `createUsersWithArrayInput` endpoint now shows: |
| 47 | +- Body parameter: `User array[User] (required)` instead of just `User (required)` |
| 48 | + |
| 49 | +Or similar array body parameters show the `array[TypeName]` format. |
| 50 | + |
| 51 | +### 5. Commit the Updated Samples |
| 52 | + |
| 53 | +```bash |
| 54 | +git add bin/configs/html.yaml |
| 55 | +git add samples/documentation/html/ |
| 56 | +git commit -m "Add html.yaml config and update HTML samples after array type fix" |
| 57 | +``` |
| 58 | + |
| 59 | +### 6. Optional: Run Tests |
| 60 | + |
| 61 | +```bash |
| 62 | +mvn verify -Psamples |
| 63 | +``` |
| 64 | + |
| 65 | +### 7. Push All Changes |
| 66 | + |
| 67 | +```bash |
| 68 | +git push origin claude/fix-html-array-types-aPDDX |
| 69 | +``` |
| 70 | + |
| 71 | +## Verification |
| 72 | + |
| 73 | +To verify the fix is working correctly, look for any endpoint in the generated HTML that has an array body parameter. For example, in the Petstore spec, the `/user/createWithArray` endpoint should show: |
| 74 | + |
| 75 | +```html |
| 76 | +<div class="param">user array[<a href="#User">User</a>] (required)</div> |
| 77 | +``` |
| 78 | + |
| 79 | +Instead of: |
| 80 | + |
| 81 | +```html |
| 82 | +<div class="param">user <a href="#User">User</a> (required)</div> |
| 83 | +``` |
| 84 | + |
| 85 | +## Current Status |
| 86 | + |
| 87 | +✅ Template fix committed |
| 88 | +✅ Config file created |
| 89 | +❌ Samples not regenerated (requires build) |
| 90 | +❌ Tests not run (requires build) |
| 91 | + |
| 92 | +The template fix is correct and ready, but sample regeneration is required to complete the PR per contribution guidelines. |
0 commit comments