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

Request/response class schema not accurately labeled in Swagger UI #2943

Closed
hojoungjang opened this issue Mar 21, 2025 · 1 comment
Closed
Labels
duplicate This issue or pull request already exists

Comments

@hojoungjang
Copy link

hojoungjang commented Mar 21, 2025

Describe the bug

I noticed that when using DTO classes for my controllers' requests and responses, they are not properly labeled with their class names on the generated Swagger documentation. Instead, they are simply labeled as object.

This was seen on the latest version v2.8.5. But when I downgrade to 2.7.0, the request and response schemas are correctly labeled with the DTO class names. I also tested on v2.8.0 and the label was back to object so I assume this behavior is seen on v2.8.0+.

This may not be a bug, but I wanted to confirm just in case.
Also, if this is a regression, I would love to see if this issue is fairly easy for me to pick up and contribute. Thanks!

To Reproduce
I have created a sample application to demonstrate this. Here is the repo.

I am using the following versions:

  • Spring boot version: 3.4.4
  • springdoc-openapi-starter-webmvc-ui:2.8.5

Expected behavior
My expectation is that any request/response should be labeled with the class name of the implemented data class rather than ambiguous object labels.

Screenshots

Screenshot of the issue

Image

Screenshot of expectation (using v2.7.0)

Image
@hojoungjang hojoungjang changed the title Request/response class schema not accurately described in Swagger UI Request/response class schema not accurately labeled in Swagger UI Mar 21, 2025
@Mattias-Sehlstedt
Copy link

Hi, please see this explanation #2867 (comment) and this solution #2867 (comment).

@bnasslahsen bnasslahsen added the duplicate This issue or pull request already exists label Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants