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

Missing component schemas in api-spec since 2.8.2 #2889

Closed
j-ferreira opened this issue Feb 5, 2025 · 4 comments
Closed

Missing component schemas in api-spec since 2.8.2 #2889

j-ferreira opened this issue Feb 5, 2025 · 4 comments
Labels
invalid This doesn't seem right

Comments

@j-ferreira
Copy link

We recently updated to the newest 2.8 version.
However, we noticed that a few component schemas in the api-spec were missing.
I went through version by version and realized that this problem exists since the 2.8.2 version.
I then looked at the code and I'm not quite sure but I believe it is due to the following change:

v2.8.1...v2.8.2#diff-87e7e89a4e291672d4d77b42e674b6a906a0c94d2b13269705dc0af95aed59d4R123

What is the background that the PolymorphicModelConverter skips schemas when the Schema annotation is added and how we can fix it that all schemas are in the api-spec available again?

I tried with api spec version 3.0.1 and 3.1.0 but there is no different in the output of the api-spec.

@Mattias-Sehlstedt
Copy link

Hi, could we clarify exactly what version "newest 2.8 version" refers to? I would assume 2.8.4?

Further adjustments were made here for version 2.8.3 8648879#diff-87e7e89a4e291672d4d77b42e674b6a906a0c94d2b13269705dc0af95aed59d4R125.

Could you provide a minimal HelloController that reproduces the scenario where there are missing component schemas?

@bnasslahsen
Copy link
Collaborator

@j-ferreira,

You should use the latest springdoc-openapi release, before reporting bugs.
Your issue is not reproducible.
Feel free to provide a Minimal, Reproducible Example - with HelloController that reproduces the problem.

This ticket will be closed, but can be reopened if your provide the reproducible sample.

@bnasslahsen bnasslahsen added the invalid This doesn't seem right label Feb 8, 2025
@j-ferreira
Copy link
Author

@bnasslahsen @Mattias-Sehlstedt
I'm tested that with 2.8.1, 2.8.2, 2.8.3 and 2.8.4 and I have the problems in all versions >= 2.8.2. Therefore I checked the code and found the change that I posted. I had seen that this code had changes also in 2.8.3.

I'm not trying to report a bug here. I would just like to understand what the technical background is for skipping classes that have the schema annotation? Before I report an bug I would like to understand what the background is and maybe I missed to migrate something somewhere.

@Mattias-Sehlstedt
Copy link

Hi @j-ferreira

The description for the change can be found here, I am only a learner through contribution, so it does not tell me too much.

It would be easier to reason around a concrete code example of the scenario (i.e., a minimal HelloController with your scenario), since then it would be easy to deduce whether the introduced change removes too much or if it is that there is a misunderstanding regarding the usage of the Schema annotation. Especially since this seems to be related to polymorphism which can be a bit tricky with how Jackson annotation also affects it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants