Skip to content

Path parameters as function positional arguments - #1

Closed
tsotnikov wants to merge 5 commits into
mainfrom
path-parameters-args
Closed

Path parameters as function positional arguments#1
tsotnikov wants to merge 5 commits into
mainfrom
path-parameters-args

Conversation

@tsotnikov

@tsotnikov tsotnikov commented May 14, 2021

Copy link
Copy Markdown
Collaborator

OpenAPI Specification indicates that if parameter location is path
the required property is REQUIRED and its value MUST be true

Ref: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object

With this in mind, this PR:

  • Tighten the parsing by throwing an error for path parameters with required=false
  • Update the templates to pass the path parameters to the function as positional arguments instead of kwargs
    to improve usability

@tsotnikov
tsotnikov requested review from dpaneda and own3dh2so4 May 17, 2021 07:54
@tsotnikov tsotnikov changed the title Path parameters as function arguments Path parameters as function positional arguments May 17, 2021
OpenAPI Specification indicates that if parameter location is `path`
the `required` property is REQUIRED and its value MUST be `true`

Ref: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object

With this in mind, this PR:

- Tighten the parsing by throwing an error for path parameters with required=false
- Update the templates to pass the path parameters to the function as positional arguments instead of kwargs
to improve usability
@tsotnikov
tsotnikov force-pushed the path-parameters-args branch from c819d65 to fd5629f Compare May 17, 2021 13:26
tsotnikov and others added 2 commits May 25, 2021 10:13
Also fix typo

Co-authored-by: Dylan Anthony <43723790+dbanty@users.noreply.github.com>
@tsotnikov tsotnikov closed this May 25, 2021
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

Successfully merging this pull request may close these issues.

3 participants