不是有效的参数定义 Swagger.json
Not a valid parameter definition Swagger.json
我有这个 swagger 定义
/memberdetails/Prospect:
post:
tags:
- memberdetails
summary: Create member details using member object.
operationId: memberdetails.Prospect
parameters:
- name: authenticationkey
in: formData
required: true
type: string
format: JSON
- name: member_object
in: form
required: true
type: string
format: JSON
responses:
'200':
description: Request was successful
schema:
type: object
properties:
data:
type: object
deprecated: false
但它给我以下错误
✖ Swagger Error Not a valid parameter definition Jump to line 6996
Details Object code: "ONE_OF_MISSING" params: Array [0] message:
"Not a valid parameter definition" path: Array [5] schemaId:
"http://swagger.io/v2/schema.json#" inner: Array [2] level: 900 type:
"Swagger Error" description: "Not a valid parameter definition"
lineNumber: 6996
你的第二个参数有一个无效的 "in" 值,它应该是 formData。
根据 Swagger 规范:
in:参数的位置。可能的值为 "query"、"header"、"path"、"formData" 或 "body".
我有这个 swagger 定义
/memberdetails/Prospect:
post:
tags:
- memberdetails
summary: Create member details using member object.
operationId: memberdetails.Prospect
parameters:
- name: authenticationkey
in: formData
required: true
type: string
format: JSON
- name: member_object
in: form
required: true
type: string
format: JSON
responses:
'200':
description: Request was successful
schema:
type: object
properties:
data:
type: object
deprecated: false
但它给我以下错误
✖ Swagger Error Not a valid parameter definition Jump to line 6996 Details Object code: "ONE_OF_MISSING" params: Array [0] message: "Not a valid parameter definition" path: Array [5] schemaId: "http://swagger.io/v2/schema.json#" inner: Array [2] level: 900 type: "Swagger Error" description: "Not a valid parameter definition" lineNumber: 6996
你的第二个参数有一个无效的 "in" 值,它应该是 formData。
根据 Swagger 规范:
in:参数的位置。可能的值为 "query"、"header"、"path"、"formData" 或 "body".