Represent XML tag with multiple namespaces #4992
-
Hi, I need to represent a Soap request that has the Envelope like this "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:other = "http:example..">". In the oas actually the request look like this: "createEnvelopeRequest": {
"type": "object",
"required": [
"soap:Body"
],
"properties": {
"soap:Body": {
"type": "object",
"required": [
"CreateAuthReq"
],
"properties": {
"CreateAuthReq": {
"$ref": "#/components/schemas/createRequest"
}
},
"xml": {
"name": "Body",
"prefix": "soap"
}
}
},
"xml": {
"name": "Envelope",
"namespace": "http://schemas.xmlsoap.org/soap/envelope/",
"prefix": "soap"
}
}, How can I modify this to have multiple namespace/attributes(xmlns:other) in the soap:Envelope tag? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@nickkpiccoli I believe the issue here is not multiple attributes (which can be done), but multiple namespaces, as the @ralfhandl any ideas here? I don't know enough about XML Namespaces to understand why the |
Beta Was this translation helpful? Give feedback.
The workaround is to declare the
other
prefix on the nested node (element or attribute) that needs it. Pulling an XML namespace declaration up to an enclosing XML element or the XML document root node is just a convenience/shorthand. From an XML perspective these are equivalent:and
With OpenAPI 3.2 each element and attribute can be represented as a node with the corresponding
nodeType
…