I am creating swagger documentation for an API and I would like to add XML example but I can't do it.
This is the swagger documentation that I've written:
swagger: "2.0"
info:
title: Documentatie API
description: Descriere documentatie API metode POST
version: 1.0.0
host: xxx.ro
basePath: /v1
schemes:
- https
paths:
/stareMesaj:
post:
summary: Stare mesaj
description: Descriere stare mesaj
consumes:
- application/xml
produces:
- application/xml
responses:
200:
description: OK
schema:
type: object
properties:
id:
type: integer
example: 4
name:
type: string
example: Arthur Dent
I was thinking that the proprieties under schema would transform in an example but it says :
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML example cannot be generated; root element name is undefined -->
Can you please give me an example ?