Represent XML tag with multiple namespaces #4992
Answered
by
ralfhandl
nickkpiccoli
asked this question in
Q&A
|
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? |
Answered by
ralfhandl
Sep 30, 2025
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 |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The workaround is to declare the
otherprefix 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…