Skip to content

feat: Allow path parameters to be positional args [#429]. Thanks @tsotnikov! #464

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

Merged
merged 10 commits into from
Aug 15, 2021

Conversation

dbanty
Copy link
Collaborator

@dbanty dbanty commented Aug 7, 2021

This replaces #429 so I can rebase and resolve conflicts.

@codecov
Copy link

codecov bot commented Aug 7, 2021

Codecov Report

Merging #464 (b672f24) into main (c5293bf) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #464   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           47        47           
  Lines         1594      1614   +20     
=========================================
+ Hits          1594      1614   +20     
Impacted Files Coverage Δ
openapi_python_client/parser/openapi.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5293bf...b672f24. Read the comment docs.

@dbanty dbanty added this to the 0.10.2 milestone Aug 7, 2021
@dbanty
Copy link
Collaborator Author

dbanty commented Aug 7, 2021

FYI @mtovts this will conflict with #458 once merged. I'll plan on waiting on yours first so I can handle the conflicts here.

@forest-benchling this is based on another stale PR I've been neglecting, I could use a fresh set of eyes on it if you have a chance to take a look.

@mtovts
Copy link
Contributor

mtovts commented Aug 9, 2021

@dbanty Thank you! Seems I am ready with #458.

Copy link
Collaborator

@forest-benchling forest-benchling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Dylan!

tsotnikov and others added 7 commits August 15, 2021 11:36
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
Also fix typo

Co-authored-by: Dylan Anthony <[email protected]>
@dbanty dbanty force-pushed the path-parameters-args branch from ff3211a to f0fe788 Compare August 15, 2021 18:16
@dbanty dbanty merged commit 9d991ec into main Aug 15, 2021
@dbanty dbanty deleted the path-parameters-args branch August 15, 2021 18:37
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.

4 participants