3scale-archive / 3scale-cli

DEPRECATED Beta of 3scale CLI, manage your 3scale installation directly from terminal (community supported)
https://www.3scale.net
MIT License
9 stars 21 forks source link

Incorrect parsing of parameters object #43

Open kevprice83 opened 7 years ago

kevprice83 commented 7 years ago

The following excerpt of a valid Swagger spec fails when creating the mapping rule:

paths:
  /coffees/{id}:
    get:
      tags:
      - "CoffeeObject"
      description: ""
      operationId: "getCoffeeObject"
      consumes:
      - "application/json"
      produces:
      - "application/json"
      parameters:
      - name: "user_key"
        in: "query"
        description: ""
        required: false
        type: "string"
      responses:
        200:
          description: ""
          schema:
            $ref: "#/definitions/Coffee"
    parameters:
    - name: "id"
      in: "path"
      description: ""
      required: true
      type: "string"

The second parameter declaration is defined as a direct child of the path item which results in the following error:

ERROR encountered on creating Mapping rule: {"http_method":["is not included in the list"]}

On the output of the import command you can see that the method is created in 3scale with the wrong HTTP verb:

Method _coffees__id__PARAMETERS with system_name _coffees__id__PARAMETERS created on 3scale.

Once the parameters object is moved inside the operation item the tool is able to import the swagger spec successfully.

cc @picsoung

picsoung commented 7 years ago

hey @kevprice83 did you try the newest version pushed yesterday?

This problem should have been resolved. Let me know

kevprice83 commented 7 years ago

@picsoung no I didn't. I wasn't aware this was already fixed. I will try on Monday, thanks for the quick turnaround