Swagger-editor: Should be a object error in yaml file

Created on 24 May 2017  路  3Comments  路  Source: swagger-api/swagger-editor

I keep getting Should be a object error on line 37 where the following path is defined: ' /api/calcRating/ocp:' ... I removed the definitions at the bottom to keep it concise.

Does anyone have any suggestions on how to fix this?

swagger: 2.0
info:
  description: Rating Engine that calculates rates for Owner's Edge
  version: 1.0.0
  title: Owner's Edge - Rating Engine API
  contact:
    email: [email protected]
schemes:
- https
basePath: "/"
paths:
  /api/calcRating/oi:
    post:
      tags:
      - calculate rating
      summary: calculates oi rating
      description: takes an oi submission and responds with a rating
      operationId: addPet
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - in: body
        name: body
        description: Pet object that needs to be added to the store
        required: true
        schema:
          $ref: '#/definitions/OiSubmission'
      responses:
        200:
          description: successful operation
          schema:
            type: object
            items:
              $ref: '#/definitions/OiResponse'
  /api/calcRating/ocp:
    post:
      tags:
      - calculate rating
      summary: calculates ocp rating
      description: takes an ocp submission and responds with a rating
      operationId: addPet
      consumes:
      - application/json
      produces:
      - application/json
      parameters:
      - in: body
        name: body
        description: Pet object that needs to be added to the store
        required: true
        schema:
          $ref: '#/definitions/OcpSubmission'
      responses:
        200:
          description: successful operation
          schema:
            type: object
            items:
              $ref: '#/definitions/OcpResponse'

All 3 comments

swagger: 2.0 _must be_ swagger: "2.0" (i.e. a string). Start there, and make your operation id values unique.

@fehguy Thanks for the tip. I fixed both but still get the same error.

Never mind. Really appreciate the help! I simply cut/paste the updated yaml paramaters into the editor and they work well now!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

delim29 picture delim29  路  4Comments

rrberry picture rrberry  路  4Comments

fchebbo picture fchebbo  路  5Comments

marcopiraccini picture marcopiraccini  路  3Comments

variable picture variable  路  4Comments