Commit 84ac22a
authored
Generate the OpenAPI spec on a free port (#7777)
`generateOpenApiDocs` forks a Spring Boot instance to harvest the spec,
but the scrape URL was hardcoded to `http://localhost:8080` - the app's
own port. If any Stirling instance is already listening there (a dev
server, a container, a WSL relay) the plugin reads **that** build
instead of the fork, and `task tool-models` then generates the Python
and TypeScript models from whatever happens to be running.
It fails silently and looks like success. I hit it while regenerating
models after editing Java annotations: the build passed, the compiled
class contained the new text, and the spec contained none of it.
Fetching the URL by hand settled it:
```
paths live8080: 276 ours: 276
identical parsed content: True
```
The generated `SwaggerDoc.json` was the running instance's document, not
the working tree's.
Now on a random free port, passed to both the fork and the scrape URL so
they cannot disagree. Override with `-PopenApiPort=NNNN` to use a
specific port.1 parent 70cdf24 commit 84ac22a
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
455 | 458 | | |
456 | | - | |
| 459 | + | |
| 460 | + | |
457 | 461 | | |
458 | 462 | | |
459 | 463 | | |
| |||
0 commit comments