swagger.io: Not a valid parameter definition on header required property -
i'm documenting api on swagger.io. when try define session_token required string property in header, error:
my definition matches sample in documentation i'm not sure s causing issue.
snippet
/customerverifylogin: post: summary: validate verification code sent authenticate login. returns session_token parameters: - name: authorization in: header type: string required: true default: basic ywrtaw46wdrcbzviwnztamlxu0hozdfmognpuhkyuerzekuwu3i= - name: session_type in: header type: string enum: - android - ios required: true - name: verificationcode in: body type: string required: true description: schema: type: object properties: phone: type: string description: mobile number verification sent. device_id: type: string description: id uniquely identifies device code: in: body type: integer format: int32 required: true description: verification code validated. responses: 200: description: customer logged-in successfully. schema: $ref: '#/definitions/customer' tags: - verification - login
a couple errors in document:
verificationcode
showstype: string
,schema:
. body param (in: body
), can useschema
. deletetype: string
.- your definition property
code
has unwanted fields:- remove
in: body
. that's copy/paste error - remove
required: true
. that's not correct way property required, move sibling ofproperties
object such:
- remove
required: - code properties: code: # rest of definition
Comments
Post a Comment