-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
@Schema annotation is not picked up when using @JsonValue from Jackson #3904
Comments
frantuma
added a commit
that referenced
this issue
Apr 17, 2021
frantuma
added a commit
that referenced
this issue
Apr 17, 2021
frantuma
added a commit
that referenced
this issue
Apr 17, 2021
frantuma
added a commit
that referenced
this issue
Apr 17, 2021
Thanks for reporting and investigating! Fixed in #3930 |
sgrimm
added a commit
to terraware/terraware-server
that referenced
this issue
Sep 2, 2021
Previously, if we wanted to include an ID value in the URL path, we had to declare the path variable as `Long` in the controller and then explicitly create an ID wrapper object. This was needed because Spring MVC didn't know how to convert a string to an instance of an ID wrapper class. So the simple fix is to add a constructor to the wrapper classes that takes a string argument. If the client uses a non-numeric value, it will fail with HTTP 400 the same way it fails with `Long` parameters. Update all the controller methods that used to take `Long` arguments to instead use the appropriate wrapper classes. This caused us to hit swagger-api/swagger-core#3904 so upgrade the OpenAPI library to get the fix for that.
sgrimm
added a commit
to terraware/terraware-server
that referenced
this issue
Sep 2, 2021
Previously, if we wanted to include an ID value in the URL path, we had to declare the path variable as `Long` in the controller and then explicitly create an ID wrapper object. This was needed because Spring MVC didn't know how to convert a string to an instance of an ID wrapper class. So the simple fix is to add a constructor to the wrapper classes that takes a string argument. If the client uses a non-numeric value, it will fail with HTTP 400 the same way it fails with `Long` parameters. Update all the controller methods that used to take `Long` arguments to instead use the appropriate wrapper classes. This caused us to hit swagger-api/swagger-core#3904 so upgrade the OpenAPI library to get the fix for that.
sgrimm
added a commit
to terraware/terraware-server
that referenced
this issue
Sep 2, 2021
Previously, if we wanted to include an ID value in the URL path, we had to declare the path variable as `Long` in the controller and then explicitly create an ID wrapper object. This was needed because Spring MVC didn't know how to convert a string to an instance of an ID wrapper class. So the simple fix is to add a constructor to the wrapper classes that takes a string argument. If the client uses a non-numeric value, it will fail with HTTP 400 the same way it fails with `Long` parameters. Update all the controller methods that used to take `Long` arguments to instead use the appropriate wrapper classes. This caused us to hit swagger-api/swagger-core#3904 so upgrade the OpenAPI library to get the fix for that.
sgrimm
added a commit
to terraware/terraware-server
that referenced
this issue
Sep 2, 2021
Previously, if we wanted to include an ID value in the URL path, we had to declare the path variable as `Long` in the controller and then explicitly create an ID wrapper object. This was needed because Spring MVC didn't know how to convert a string to an instance of an ID wrapper class. So the simple fix is to add a constructor to the wrapper classes that takes a string argument. If the client uses a non-numeric value, it will fail with HTTP 400 the same way it fails with `Long` parameters. Update all the controller methods that used to take `Long` arguments to instead use the appropriate wrapper classes. This caused us to hit swagger-api/swagger-core#3904 so upgrade the OpenAPI library to get the fix for that.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See: springdoc/springdoc-openapi#1077
I debugged the code and I found the issue at the following place:
swagger-core/modules/swagger-core/src/main/java/io/swagger/v3/core/jackson/ModelResolver.java
Lines 371 to 379 in 438230d
Unlike in other places, at this point the
.ctxAnnotations(schemaAnnotations)
method is not called which results in the loss of data coming from@Schema
annotation.The text was updated successfully, but these errors were encountered: