Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

required field doesn't work #118

Open
jayai2014 opened this issue Jul 23, 2019 · 0 comments
Open

required field doesn't work #118

jayai2014 opened this issue Jul 23, 2019 · 0 comments

Comments

@jayai2014
Copy link

For pathParams, required field doesn't seem to work.
My example:

      - http:
          path: files
          method: get
          cors: true
          authorizer: aws_iam
          documentation:
            summary: File search
            description: >
              Provides the ability to search files with custom filters.
            pathParams:
              -
                name: query
                description: The query string (use empty string for no filter)
                required: true
              -
                name: rowsPerPage
                description: Number of rows to be returned (default 20)
                required: false
              -

I explicitly set required: false, however after I deployed the APIs, I did an export and these fields are marked as required true in the exported API documentation. Like below

parameters:
      - name: "page"
        in: "path"
        description: "Current pagination index (default 0)"
        required: true
        schema:
          type: "string"
      - name: "query"
        in: "path"
        description: "The query string (use empty string for no filter)"
        required: true
        schema:
          type: "string"
      - name: "sortAsc"
        in: "path"
        description: "Sort in ascending order (default false)"
        required: true
        schema:
          type: "string"

Also, AWS doesn't seem to give me any information on whether a parameter is required or not.
image

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

No branches or pull requests

1 participant