You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Thorsten Roemer (Jira)" <ji...@apache.org> on 2021/09/20 08:41:00 UTC
[jira] [Created] (CAMEL-16986) Add support for description and
example in @Schema annotation
Thorsten Roemer created CAMEL-16986:
---------------------------------------
Summary: Add support for description and example in @Schema annotation
Key: CAMEL-16986
URL: https://issues.apache.org/jira/browse/CAMEL-16986
Project: Camel
Issue Type: Improvement
Components: camel-openapi-java
Affects Versions: 3.11.2
Environment: Maven dependencies:
* camel-openapi-java-starter:3.11.2
* camel-openapi-java:3.11.2
* swagger-core: 2.1.20
Reporter: Thorsten Roemer
When using the @Schema annotation for OpenAPI documentation, the "description" and "example" parameters are apparently ignored because the generated JSON file does not contain any of these elements.
E.g.:
{code:java}
@io.swagger.v3.oas.annotations.media.Schema(description = "The transaction id", example = "id-123")
String id;
{code}
Current generated JSON:
{noformat}
[...]
"components" : {
"schemas" : {
"Example" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string"
},
[...]
{noformat}
Expected generated JSON:
{noformat}
[...]
"components" : {
"schemas" : {
"Example" : {
"type" : "object",
"properties" : {
"id" : {
"description" : "The transaction id",
"type" : "string",
"example" : "id-123"
},
[...]
{noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)