【发布时间】:2020-06-18 23:10:51
【问题描述】:
您好,我正在为 api 创建 swagger 文档,我想添加 xml 示例,但我做不到。
这是我写的大摇大摆的文档
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
我在想模式下的属性会在一个例子中改变,但它说:
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML example cannot be generated; root element name is undefined -->
你能给我一个例子吗?
提前致谢
【问题讨论】:
标签: xml api swagger documentation