Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing 'parameters' definitions for path parameters #6

Open
DALDEI opened this issue Jan 26, 2016 · 1 comment
Open

Missing 'parameters' definitions for path parameters #6

DALDEI opened this issue Jan 26, 2016 · 1 comment

Comments

@DALDEI
Copy link

DALDEI commented Jan 26, 2016

I imported into API Gateway a Swagger definition using your importer tool.
A small snippet of a path 👍

paths:
  '/service/{cluster-id}':
    parameters:
      - name: 'cluster-id'
        in: path
        type: string
        format: uint64
        required: true
        description: The ID of the cluster as an unsigned long decimal string

    post:
      tags:
        - service
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - in: body
          name: body
          required: true
          schema:
            $ref: '#/definitions/registerServiceRequest'
      responses:
        '200':
          description: Success
          schema:
            $ref: '#/definitions/registerServiceResponse'
        '406':
          description: Error 406

When its exported using either the AWS Export GUI or your tool the path parameter definitions are gone. I realize there is no direct equivalent in API Gateway (except the Path mapping for HTTP integrations), and there is no schema for them. But I was hoping that an import then export might round trip well enough to be usable.

As it is now paths with /{param} but no parameters declarations dont parse in swagger.
I tried using global parameter defs, path and operation parameters and none show up in the output.

example:
( Note a truncated path -- I will file a separate issue)

paths:
  rvice/{foo-id}:
    post:
      parameters:
      - in: "body"
        name: "body"
        description: "registerFooRequest"
        required: false
        schema:
          type: "object"
          required:
          - "app-token"
          - "timestamp"
          properties:
            app-token:
              type: "string"
              description: "A valid service application token"
            timestamp:
              type: "string"
              format: "date-time"
              description: "The request timestamp"
      responses:
        200:
          description: "registerFooResponse"
          schema:
            $ref: "#/definitions/registerFooResponse"
        406: {}
      x-amazon-apigateway-auth:
        type: "NONE"
@isabinin
Copy link
Owner

Unfortunately almost all of definition info for path parameters (same for query parameters and header parameters) is lost when imported into API Gateway. It keeps "required" flag only (and obviously "in").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants