You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lost deprecated attribute after updating to 2.8.16 #3250
The issue most likely lies within transitive dependencies that you have that springdoc uses (e.g., swagger-core), and that you are using a version that is incompatible with springdoc 2.8.16. If you believe springdoc is at fault. Then please provide a HelloController similar to that shared by me that reproduces your issue within this repository.
It looks like the cause could be tied to the upgrade of swagger-core, and that this issue is this exact issue. I have updated my own branch with the case provided by minman, and also shown that the deprecation is treated correctly again if the @NotNull is removed from DTO2. I.e., the issue is actually tied to swagger-core, and should preferably be corrected there.
Activity
Mattias-Sehlstedt commentedon Mar 25, 2026
Hi, these are the different modules that springdoc offers, so the question is what type of spring application and specification-ui that you are using.
A HelloController is just the simplest controller possible, e.g.,
This produces an expected deprecated for me when resolving to 3.0. See main...Mattias-Sehlstedt:springdoc-openapi:missing-deprecated#diff-2289cb6b8ff406dc3091863f6a8a8c509930d24b52f9c818a7916c771c476fc6R50.
The issue most likely lies within transitive dependencies that you have that springdoc uses (e.g., swagger-core), and that you are using a version that is incompatible with springdoc 2.8.16. If you believe springdoc is at fault. Then please provide a HelloController similar to that shared by me that reproduces your issue within this repository.
minman commentedon Mar 26, 2026
Inconsitent behaviour can be reproduced using the following controller:
Result
fieldinDTOis marked as@Deprecated, then both fields (DTO and DTO2) appear as deprecated in the generated OpenAPI schema.fieldinDTO2is marked as@Deprecated, then neither field is marked as deprecated.Fixed deprecation of record properties in springdoc-openapi-starter-w…
Mattias-Sehlstedt commentedon Mar 26, 2026
Thanks for the example!
It looks like the cause could be tied to the upgrade of swagger-core, and that this issue is this exact issue. I have updated my own branch with the case provided by minman, and also shown that the deprecation is treated correctly again if the
@NotNullis removed fromDTO2. I.e., the issue is actually tied to swagger-core, and should preferably be corrected there.Mattias-Sehlstedt commentedon Mar 26, 2026
I have created PR swagger-api/swagger-core#5099 in swagger-core that should resolve the issue.