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

Add support for Falcon Resource suffixes #19

Merged
merged 3 commits into from
May 10, 2020

Conversation

henryh9n
Copy link
Contributor

@henryh9n henryh9n commented May 3, 2020

Closes #18.

Added support for the Falcon suffixes, using the Flacon's router.
There is no need to specify the suffix manually. The methods for the corresponding Resource, as is done for the path, is fetched automatically in path_helper.

Added tests for 100% coverage.

@codecov-io
Copy link

codecov-io commented May 3, 2020

Codecov Report

Merging #19 into master will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #19      +/-   ##
==========================================
+ Coverage   97.36%   97.43%   +0.06%     
==========================================
  Files           3        3              
  Lines          38       39       +1     
==========================================
+ Hits           37       38       +1     
  Misses          1        1              
Impacted Files Coverage Δ
falcon_apispec/falcon_plugin.py 97.22% <100.00%> (+0.07%) ⬆️

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 9e48608...520a825. Read the comment docs.

@henryh9n
Copy link
Contributor Author

henryh9n commented May 8, 2020

@alysivji Any update on this?

@alysivji
Copy link
Owner

alysivji commented May 8, 2020

I have 4 hours booked tomorrow to dive into this. It's been a while since I've touched Falcon and I know folks are using this in prod -- want to make sure we don't break anything (especially now there is a v2 of Falcon)

Just taking a quick look at the PR, it does look good. Do you mind updating the README.md with a small section about resource suffixes? No worries if you do not have time, I can add a commit to this branch.

Copy link
Owner

@alysivji alysivji left a comment

Choose a reason for hiding this comment

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

LGTM.

Comment on lines +52 to +56
methods = resource_uri_mapping[resource]["methods"]

for method_name, method_handler in methods.items():
docstring_yaml = yaml_utils.load_yaml_from_docstring(method_handler.__doc__)
operations[method_name] = docstring_yaml or dict()
Copy link
Owner

Choose a reason for hiding this comment

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

👍 this is a lot nicer

@alysivji alysivji changed the title Add support for Falcon Resource suffixes. Closes #18. Add support for Falcon Resource suffixes May 10, 2020
@alysivji alysivji merged commit 90d064e into alysivji:master May 10, 2020
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.

Add support for suffix="collection" routes
3 participants