I am creating swagger YAML file for my XML APIs. Existing APIs consists of multiple xml namespaces in request body (sample below). I am able to take all the API to swagger YAML except definition of namespaces as part of root element.
Any inputs on how to map multiple xml namespaces would be really helfpul.
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:
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.