swagger - Swagger/OpenApi Codegen 从 xsd 生成请求正文
问题描述
我们正在使用 swagger-codegen/openapi-codegen 来生成我们的 API。
我希望我的 API 使用"application/xml"
以及要从 xsd 方案生成的请求正文。
当我使用application/json
我的帖子代码时,如下所示:
parameters:
- in: "body"
name: "body"
description: "Request Object For Adding User"
required: true
schema:
$ref: "#/definitions/User"
虽然在定义中我有
definitions:
User:
type: "object"
required:
- "name"
- "email"
properties:
name:
type: "string"
example: "john"
email:
type: "string"
example: "john@gmail.com"
一些想法我怎么能做到这一点?
解决方案
推荐阅读
- php - PHP - Array_combine first row missing
- javascript - how to validate whether a specific email exist in the firebase database and how to fetch it for log in validation
- kotlin - 将 Firebase 列表视图转换为 Firestore 列表视图
- python - 在 Python 中构建迭代器
- javascript - Cloud Functions Puppeteer TimeoutError:尝试连接到 Chrome 时在 30000 毫秒后超时
- square-connect - square-commerce-v1 带回窗口而不是新标签
- java - 当同时存在泛型和通配符时如何推断参数类型
- sql - 合并三个表并在 oracle 中显示它们的状态(仅共享字段的最近条目)
- c# - EWS 减少邮箱连接时间
- bash - 不知道如何运行 shell 脚本