Content & configuration
Swagger/OpenAPI definition:
openapi: 3.0.3
info:
title: XML Empty Tag Example
version: 1.0.0
paths:
/example:
get:
responses:
'200':
description: Example XML response
content:
application/xml:
schema:
type: object
xml:
name: Response
properties:
id:
type: string
name:
type: string
emptyTag:
type: object
xml:
name: EmptyTag
Swagger-UI configuration options:
SwaggerUI({
// default configuration
})
Is your feature request related to a problem?
Yes. When Swagger UI generates an XML example for an empty XML element, it does not self-close the element (EmptyTag in the following example):
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<id>string</id>
<name>string</name>
<EmptyTag>
</EmptyTag>
</Response>
Describe the solution you'd like
When generating XML examples, Swagger UI should generate empty elements using the self-closing XML syntax:
instead of:
Content & configuration
Swagger/OpenAPI definition:
Swagger-UI configuration options:
Is your feature request related to a problem?
Yes. When Swagger UI generates an XML example for an empty XML element, it does not self-close the element (
EmptyTagin the following example):Describe the solution you'd like
When generating XML examples, Swagger UI should generate empty elements using the self-closing XML syntax:
<EmptyTag/>instead of: