Forum Discussion

salem's avatar
salem
Occasional Visitor
3 years ago

OpenAPI 3.0 - Issue describing an object for XML tag in OpenAPI 3.0 objects that have

I can't get Swagger UI to create an appropriate XML tag with an attribute and content ( objects that have both attributes and a value ) :

 

<filter id="id001" attr1="admin">Administrator</filter>

and instead, I get this

 

<filter>Administrator</filter>

 

if I use this schema

 

components:
  schemas:
    Filter:
      type: object
      example: Administrator
      properties:
        id:
          type: string
          example: id001
          xml:
            attribute: true
        attr1:
          type: string
          example: admin
          xml:
            attribute: true

or this

<filter attr1="id001" attr1="admin"></filter>

 

if I use this schema

 

components:
  schemas:
    Filter:
      type: object
      properties:
        id:
          type: string
          example: id001
          xml:
            attribute: true
        attr1:
          type: string
          example: admin
          xml:
            attribute: true

 

I try many ways to solve this issue but no luck

No RepliesBe the first to reply