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:

enter image description here

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 shows type: string , schema:. body param (in: body), can use schema. delete type: 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 of properties object such:
required:   - code properties:   code:    # rest of definition 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -