Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The example value of the request body in swagger has a "string" value #10343

Open
ignat233 opened this issue Mar 5, 2025 · 0 comments
Open

Comments

@ignat233
Copy link

ignat233 commented Mar 5, 2025

The example value of the request body in swagger has a "string" value.

looks like https://private-user-images.githubusercontent.com/78956054/253351022-15d7b5a8-1068-405c-b997-bccb3a8e4aa0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDExNTc3ODksIm5iZiI6MTc0MTE1NzQ4OSwicGF0aCI6Ii83ODk1NjA1NC8yNTMzNTEwMjItMTVkN2I1YTgtMTA2OC00MDVjLWI5OTctYmNjYjNhOGU0YWEwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAzMDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMzA1VDA2NTEyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcxYjMzN2U0OTFiZWQxZjVjNzM1NzlhMjA1ZDZmY2U3Mjg4N2NiNGY0ZjJiM2VlNGZmMmE1MjNlNDAwNDE0MTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.sAR2C33d1St_mqW4E46-0Vci6HDVaIQs6mIudessriw

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant