Ensure doc, auth_required, and input will run ensure_async#289
Merged
greyli merged 2 commits intoapiflask:mainfrom May 17, 2022
jiashuChen:main
Merged
Ensure doc, auth_required, and input will run ensure_async#289greyli merged 2 commits intoapiflask:mainfrom jiashuChen:main
greyli merged 2 commits intoapiflask:mainfrom
jiashuChen:main
Conversation
✅ Deploy Preview for apiflask ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
greyli
requested changes
May 16, 2022
src/apiflask/scaffold.py
Outdated
| f._spec['args'].append((schema, location)) | ||
| return use_args(schema, location=location, **kwargs)(f) | ||
|
|
||
| @wraps(f) |
Member
There was a problem hiding this comment.
Please move the code to a separate function to prevent repetition and call it for each decorator (see the example implementation in APIFairy).
tests/test_async.py
Outdated
| skip_flask1(app) | ||
|
|
||
| @app.get('/') | ||
| @app.doc(summary="Test Root Endpoint") |
Member
There was a problem hiding this comment.
Use single quotes in all places.
setup.py
Outdated
| 'dotenv': ['python-dotenv'], | ||
| 'yaml': ['pyyaml'], | ||
| 'async': ['asgiref >= 3.2'], | ||
| 'async': ['asgiref >= 3.2', 'flask[async]>=2.0.0'], |
Member
There was a problem hiding this comment.
I think it's no need to pin the Flask version. If the user wants to use the async feature, they will use Flask 2.
Signed-off-by: Jiashu Chen <[email protected]>
Contributor
Author
|
Hi @greyli, thank you for the review feedbacks, I've updated the pull request accordingly. Regards, |
greyli
approved these changes
May 17, 2022
Member
|
Merged, thanks! I will update the double quotes in the tests later. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: Important to test this with flask >= 2.0
Checklist:
docsfolder and in code docstring.CHANGES.mdsummarizing the change and linking to the issue and your username.*Version changed*or*Version added*note in any relevant docs and docstring.pytestandtox, no tests failed.