You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Jakub (Jira)" <ji...@apache.org> on 2023/06/01 09:25:00 UTC

[jira] [Updated] (CAMEL-19406) XML property ommited in RestModelConverters

     [ https://issues.apache.org/jira/browse/CAMEL-19406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jakub updated CAMEL-19406:
--------------------------
    Description: 
The RestModelConverters class, which converts Swagger Models to OASSchemas, ommits entirely XML property of the model object.

For exaple, having property "serverVersion" as XML Attritbute in generated Swagger Model:
{code:java}
class Schema {
    type: object
    format: null
    $ref: null
    not: null
    properties: {
        serverVersion=class StringSchema {
            class Schema {
                type: string
                format: null
                $ref: null
                properties: null
                additionalProperties: null
                deprecated: null
                discriminator: null
                xml: class XML {
                    name: null
                    namespace: null
                    prefix: null
                    attribute: true
                    wrapped: null
                }
            
            }
        }
    }
} {code}
The given Oas30Schema is an output (shortened):
{code:java}
model = {Oas30Schema$Oas30PropertySchema@19089} 
 _propertyName = "serverVersion"
 oneOf = null
 anyOf = null
 not = null
 discriminator = null
 xml = null
 externalDocs = null
 example = null {code}
Instead of (shortened)
{code:java}
model = {Oas30Schema$Oas30PropertySchema@10558} 
 _propertyName = "serverVersion"
 oneOf = null
 anyOf = null
 not = null
 discriminator = null
 xml = {Oas30XML@10561} 
  name = null
  namespace = null
  prefix = null
  attribute = {Boolean@19177} true
  wrapped = null
 externalDocs = null
 example = null {code}
This leads to incorrectly generated api-doc which is used by Swagger, and therefore response example are also incorrect (all fields are XML elemements instead of some of them being attributes)

Generated api-doc part:
{code:java}
 "serverVersion" : {
     "type" : "string"
 }{code}
Instead of:
{code:java}
 "serverVersion" : {
    "type" : "string",
    "xml" : {
       "attribute" : true
    }
 } {code}
 

PS. this is my first issue created here so please let me know if I should provide additional information or change anything in the ticket.

  was:
The RestModelConverters class, which converts Swagger Models to OASSchemas, ommits entirely XML property of the model object.

For exaple, having property "serverVersion" as XML Attritbute in generated Swagger Model:
{code:java}
class Schema {
    type: object
    format: null
    $ref: null
    not: null
    properties: {
        serverVersion=class StringSchema {
            class Schema {
                type: string
                format: null
                $ref: null
                properties: null
                additionalProperties: null
                deprecated: null
                discriminator: null
                xml: class XML {
                    name: null
                    namespace: null
                    prefix: null
                    attribute: true
                    wrapped: null
                }
            
            }
        }
    }
} {code}
The given Oas30Schema is an output (shortened):
{code:java}
model = {Oas30Schema$Oas30PropertySchema@19089} 
 _propertyName = "serverVersion"
 oneOf = null
 anyOf = null
 not = null
 discriminator = null
 xml = null
 externalDocs = null
 example = null {code}
Instead of (shortened)
{code:java}
model = {Oas30Schema$Oas30PropertySchema@10558} 
 _propertyName = "serverVersion"
 oneOf = null
 anyOf = null
 not = null
 discriminator = null
 xml = {Oas30XML@10561} 
  name = null
  namespace = null
  prefix = null
  attribute = {Boolean@19177} true
  wrapped = null
 externalDocs = null
 example = null {code}
This leads to incorrectly generated api-doc which is used by Swagger, and therefore response example are also incorrect (all fields are XML elemements instead of some of them being attributes)

Generated api-doc part:
{code:java}
 "version" : {
     "type" : "string"
 }{code}
Instead of:
{code:java}
 "version" : {
    "type" : "string",
    "xml" : {
       "attribute" : true
    }
 } {code}
 

PS. this is my first issue created here so please let me know if I should provide additional information or change anything in the ticket.


> XML property ommited in RestModelConverters
> -------------------------------------------
>
>                 Key: CAMEL-19406
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19406
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-openapi-java
>    Affects Versions: 4.0-M3
>            Reporter: Jakub
>            Priority: Minor
>              Labels: easyfix
>
> The RestModelConverters class, which converts Swagger Models to OASSchemas, ommits entirely XML property of the model object.
> For exaple, having property "serverVersion" as XML Attritbute in generated Swagger Model:
> {code:java}
> class Schema {
>     type: object
>     format: null
>     $ref: null
>     not: null
>     properties: {
>         serverVersion=class StringSchema {
>             class Schema {
>                 type: string
>                 format: null
>                 $ref: null
>                 properties: null
>                 additionalProperties: null
>                 deprecated: null
>                 discriminator: null
>                 xml: class XML {
>                     name: null
>                     namespace: null
>                     prefix: null
>                     attribute: true
>                     wrapped: null
>                 }
>             
>             }
>         }
>     }
> } {code}
> The given Oas30Schema is an output (shortened):
> {code:java}
> model = {Oas30Schema$Oas30PropertySchema@19089} 
>  _propertyName = "serverVersion"
>  oneOf = null
>  anyOf = null
>  not = null
>  discriminator = null
>  xml = null
>  externalDocs = null
>  example = null {code}
> Instead of (shortened)
> {code:java}
> model = {Oas30Schema$Oas30PropertySchema@10558} 
>  _propertyName = "serverVersion"
>  oneOf = null
>  anyOf = null
>  not = null
>  discriminator = null
>  xml = {Oas30XML@10561} 
>   name = null
>   namespace = null
>   prefix = null
>   attribute = {Boolean@19177} true
>   wrapped = null
>  externalDocs = null
>  example = null {code}
> This leads to incorrectly generated api-doc which is used by Swagger, and therefore response example are also incorrect (all fields are XML elemements instead of some of them being attributes)
> Generated api-doc part:
> {code:java}
>  "serverVersion" : {
>      "type" : "string"
>  }{code}
> Instead of:
> {code:java}
>  "serverVersion" : {
>     "type" : "string",
>     "xml" : {
>        "attribute" : true
>     }
>  } {code}
>  
> PS. this is my first issue created here so please let me know if I should provide additional information or change anything in the ticket.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)