Attributes doesn't appears on xml tag

18 views
Skip to first unread message

Igor Silva

unread,
Oct 25, 2016, 9:40:32 AM10/25/16
to Swagger

I have an question about XML schema on Swagger Editor or UI.


I tried to create an element like below, but it have failed.


<CompanyName Code='1' CodeContext='context'>example</CompanyName>



i try using that on swagger UI:


CompanyName:
 xml:
   name: CompanyName 
 enum: [example]

 properties:
  Code:
    type: string
    enum: [1]
    xml:
      attribute: true
  CodeContext:
    type: string
    enum: [context]
    xml:
      attribute: true


But the out was :

<CompanyName>example</CompanyName>


the attributes does not appears

What's wrong with that?

Ron Ratovsky

unread,
Oct 25, 2016, 2:59:19 PM10/25/16
to swagger-sw...@googlegroups.com

It’s been a while, so I’m not 100% certain, but I believe there’s no way to describe your example.

You can end up with either:

 

<CompanyName>example</CompanyName>

 

or

 

<CompanyName Code=’1’ CodeContext=’context’/>

 

This is not a tooling issue, the spec doesn’t support your case.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages