我正在定义一个使用非JSON主体POST的资源 . 它只是一个像表单参数的字符串 . 类似于OAuth的情况:grant_type =&code =&redirect_uri =
如何在Swagger上记录?我是否必须使用formParam格式而不是body?我放入体内的所有内容都转换为JSON示例 .
TokenRequest:
properties:
grant_type:
type: string
description: OAuth Grant Type
enum:
- authorization_code
- refresh
code:
type: string
description: Authorization Code obtained from /authorize required if grant_type = au
redirect_uri:
type: string
description: Defined Redirect URI Example - https://example.com/callback
refresh_token:
type: string
description: Required if grant_type = refresh
1 回答
以下是有关如何记录表单数据的示例:
但在您的情况下,您似乎想要定义OAuth设置,因此请参阅Swagger Spec 2.0以获取更多信息 . 以下是PetStore的示例: