Forum Discussion
Hi neerajdahiya,
Please see this article: https://swagger.io/docs/specification/data-models/representing-xml/
Nastya_Khovrina: Thanks for the info. I should've more explicit in my issue, actually I am facing issue while defining multiple xml namesapce. While trying to do so, I am getting error 'duplicated mapping key'. The definition looks like:
xml:
namespace: 'http://www.abc.com/xyz/services/subscriber'
xml:
prefix: 'xsi'
namespace: 'http://www.w3.org/2001/XMLSchema-instance'
- HKosova5 years agoSmartBear Alumni (Retired)
Hi neerajdahiya,
OpenAPI Specification does not support multiple XML namespaces within a single element. As a workaround, you can define additional namespaces as regular attributes (that is, schema properties with xml.attribute=true).
openapi: 3.0.0 components: schemas: Prov: type: object xml: namespace: http://www.example.com/provisioning/services properties: "xmlns:xsi": # <---------- type: string enum:
- "http://www.w3.org/2001/XMLSchema-instance" xml: attribute: true Header: ...There's an existing enhancement request to add support for alternative schema formats, such as XSL Schema (XSD), which would enable your scenario.
Related Content
- 5 years ago
- 14 years ago
- 3 years ago
Recent Discussions
- 15 days ago
- 2 months ago