-
-
Notifications
You must be signed in to change notification settings - Fork 528
AdditionalModelsConverter Schema params rewriting #1957
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
Labels
bug
Something isn't working
Comments
Can provide a Minimal, Reproducible Example - with HelloController that reproduces the problem? |
Controller example:
And the main class:
|
bnasslahsen
added a commit
that referenced
this issue
Nov 25, 2022
Closed
mpleine
pushed a commit
to mpleine/springdoc-openapi
that referenced
this issue
May 17, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
While using AdditionalModelsConverter we've faced with a problem that many BigDecimal fields wrongly marked as deprecated in swagger json.
We return BigDecimal as String in json
{"val": "12.34"}
and use configuration:SpringDocUtils.getConfig().replaceWithSchema(BigDecimal.class, new Schema<BigDecimal>().type("string").format("decimal"));
It seems that the problem is in AdditionalModelsConverter resolve method:
https://github.com/springdoc/springdoc-openapi/blob/master/springdoc-openapi-common/src/main/java/org/springdoc/core/converters/AdditionalModelsConverter.java#L134
It returns the object from modelToSchemaMap instead of clone of this object. In SchemaPropertyDeprecatingConverter resolve method this object marked as deprecated.
https://github.com/springdoc/springdoc-openapi/blob/master/springdoc-openapi-common/src/main/java/org/springdoc/core/converters/SchemaPropertyDeprecatingConverter.java#L92
After that we have deprecated object in modelToSchemaMap.
The text was updated successfully, but these errors were encountered: