swagger-api / swagger-api/swagger-ui
The example value of the request body in swagger has a "string" value
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
The example value of the request body in swagger has a "string" value.
For some controllers, the Example value is correct, these controllers are at the top of the list alphabetically among other controllers, and for them the open api configuration occurs earlier, judging by what I see in io.swagger.v3.jaxrs2.Reader. If you change the name of the controller class for which the example request body is not configured, so that it becomes the first in the list of controllers alphabetically, then the body will be configured correctly for it, and for some requests that previously had a request body, the body will not be configured. It looks like the controller configuration is correct. Perhaps something needs to be configured additionally, as there may be some kind of limitation.
Swagger annotation and swagger-jaxrs2 have 2.2.27 version, springdoc.version with 1.8.0 version, springdoc-openapi-starter-webmvc-ui with 2.8.2 version.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the request-body example with the affected controllers and compare it with controllers ordered first alphabetically. Start by tracing OpenAPI configuration through io.swagger.v3.jaxrs2.Reader and the listed springdoc and swagger-jaxrs2 versions. Done means the affected Swagger UI request-body examples are populated consistently without breaking controllers that already show bodies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript, openapi, spring
- Domain
- api, documentation, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100