Showing results for 
Search instead for 
Did you mean: 

How to represent a mixed xml node


How to represent a mixed xml node

I'm trying to represent a mixed xml node in JSON schema. The mixed node has multiple attributes and text() contents



<desc language="en-US">Description text</desc>


I got to here:

"application/xml": {

"schema": {

"type": "object",
"properties": {

"language": {

"type": "string",
"xml": "attribute": true }

"#text": {

"type": "string"



"xml": { "name": "desc" }





But the Swagger UI (v3.38.0) generates:

<desc language="string"><#text>string</#text></desc>


Is this a bug in the framework and should #text just always be rendered as text(), is there some kind of syntax missing that allows me to be specific about what #text actually is, is there a different way to do this other than #text?

Tags (1)

Re: How to represent a mixed xml node

Hi @ahenket,


OpenAPI Specification currently does not have a way to represent such elements. See this thread for details:


Helen Kosova
SmartBear Documentation Team Lead
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video: