Replies: 2 comments
-
@dhoffer can you provide an example project? I follow what you're saying, but I don't know the answer without digging into it. |
Beta Was this translation helpful? Give feedback.
0 replies
-
As I was creating the reproducer I proved that does not work. There is nothing a serialization time that knows to use the OpenAPI Schema name property. Bur I found an easy fix, just add an @JsonProperty("uniqueId") with the same name as the @Schema name and now it does work. @id
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have a case where in the Java model/pojo they picked bad field names, e.g. they picked id & setId for two of them. id is fine but setId is not because then when we use the Java openapi codegen maven plugin it generates setId() for the id field which is expected but then it also creates another setId() method to set the setId field. It should be just making a setSetId() method but it doesn't.
So I set the name property in the @Schema annotation to be relatedSetId and now all is fine, the code gen tool now treats that field as relatedSetId not setId. But my question is what is doing the mapping of these two fields together? The client will be making a POST with the relatedSetId field name but the server (Java) model is still setId. So what is the technology that is mapping the relatedSetId field to the setId field? The only mapping is with the @Schema name property but that is an OpenAPI annotation not a JAX-RS or Jackson annotation so who/what knows to map the two different fields?
Our tech stack is Quarkus so its Netty, Vertx and then Quarkus reactive JAX-RS with Jackson Json/model binding, so where in this tech stack would this field to field mapping occur? Does it occur?
Part 2 of this question is I wonder if its possible to configure openapi-generator-maven-plugin so that it would actually make the setSetId() method instead of two setId() methods?
Beta Was this translation helpful? Give feedback.
All reactions