Open ghost opened 6 years ago
Is there a workaround for that, I also have the same problem.
Hi, i faced the same problem. Simple, but very ugly workaround is to add @Schema annotation e.g.
public static final String JSON_ATTRIBUTE_ID = "_id";
...
@Schema(name = JSON_ATTRIBUTE_ID)
@JsonbProperty(JSON_ATTRIBUTE_ID)
private Long id;
Other solution I found was to use Jackson annotations instead of JSON-B annotations. The JAX-RS implementation I work with (RESTEasy in Wildfly) can use Jackson annotations for JSON serialization/deserialization out-of-the-box (without any configuration needed). But I try to be not dependent on specific implementations of EE 8 API technologies, therefore I use the solution with @Schema
+1 for Swagger to read @JsonbProperty
I am using swagger plugin to generate classes from api spec (yaml) file. The generated model classes contains Jackson annotations. I would like to have JSON-B annotations instead of Jackson annotations. How this can be achieved?
+1 for Swagger to read @JsonbProperty
The JSON-B annotation
javax.json.bind.annotation.JsonbProperty
can be used to set a different property name for a JSON property much like the jackson annotationcom.fasterxml.jackson.annotation.JsonProperty
can.When using the jackson annotation the name is automatically used in the generated swagger documentation.
The generated documentation should also reflect the property name set with the JSON-B annotation.