0

Hi guys I am having difficulties with YAML and I need your help. I am having this code and it gives me error, and i cant find where or what i am doing wrong.Error msg that i am receiving is below

 /product/{productid}/fabric/{fabricid}:
get:
  tags:
  - "Product"
  summary: "Get Fabric by Id"
  description: "This endpoint displays Fabric details"
  produces:
  - "application/json"
  parameters:
  - name: "fabricid"
    in: "path"
    description: "This is unique identifier of the fabric"
    required: true
    type: "string"
  responses:
    200:
      description: "successful operation"
      schema:
        type: "array"
        items:
          $ref: "#/definitions/fabric"
    400:
      description: "Invalid status value"
delete:
  tags:
  - "Product"
  summary: "Delete Fabric by Id"
  description: "Delete Fabric by id"
  operationId: "deleteFabric"
  produces:
  - "application/json"
  parameters:
  - name: "fabricid"
    in: "path"
    description: "ID of the Fabric that needs to be deleted"
    required: true
    type: "integer"
    minimum: 1.0
    format: "int64"
  responses:
    200:
      description: "successful operation"
      schema:
        type: "array"
        items:
          $ref: "#/definitions/fabric"
    400:
      description: "Invalid ID supplied"
    404:
      description: "Fabric not found" 

Error msg that i am receiving. :enter image description here

Darko Todorovski
  • 173
  • 1
  • 10

1 Answers1

2

The error message is rather self-explanatory. You defined a path with 2 path parameters:

/product/{productid}/fabric/{fabricid}:

but you did not define the productid parameter in the parameters section.

Check out Paths and Operations and Describing Parameters to learn more about OpenAPI syntax for paths and parameters.

Helen
  • 87,344
  • 17
  • 243
  • 314