如何解决OpenAPI HTML 文档:如何记录 XML 细节?
如果我正确理解 XML object docs,应该可以指定例如哪些属性应该是 XML 属性而不是元素。有没有办法告诉像 swagger-codegen
这样的文档生成器写出这些信息?例如使用
java -jar swagger-codegen-cli.jar generate -i openapi.yaml -l html2
此信息似乎丢失了。实际上,整个文档看起来像 JSON 而不是像 XML...
作为参考,这是我使用的示例文件(文档读者应该看到 entity/id
是一个 XML 属性):
openapi: "3.0.0"
info:
title: CaosDB XML REST API
description: The XML API of CaosDB,see also https://docs.indiscale.com/caosdb-server
version: 0.0-poc.1
servers:
- url: https://demo.indiscale.com
description: Demo server,will reset its content from time to time.
paths:
/Entity:
get:
summary: Return an Entity.
description: This is the most direct way to return a single Entity.
responses:
'200':
description: The entity
content:
application/xml:
schema:
$ref: "#/components/schemas/entity"
components:
schemas:
entity:
type: object
properties:
id:
type: integer
xml:
attribute: true
title:
type: string
author:
type: string
xml:
name: 'xml-book'
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。