Skip to content

Conversation

@dhanababum
Copy link

RuntimeError: Working outside of application context.

This typically means that you attempted to use functionality that
needed to interface with the current application object in some way.
To solve this, set up an application context with app.app_context().

https://github.com/python-restx/flask-restx/blob/master/flask_restx/marshalling.py#L251 --> this line is protected by has_app_context
https://github.com/python-restx/flask-restx/blob/master/flask_restx/marshalling.py#L252 --> this line is not protected by has_request_context

I have integrated marshal_with serializer to database SQLAlchemy models But getting the RuntimeError: Working outside of request context

Corrected the code and successfully ran tox tests.

@codecov
Copy link

codecov bot commented Aug 16, 2021

Codecov Report

Merging #360 (d5ac614) into master (88497ce) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head d5ac614 differs from pull request most recent head eb274dd. Consider uploading reports for the commit eb274dd to get more accurate results
Impacted file tree graph

@@ Coverage Diff @@ ## master #360 +/- ## ========================================== - Coverage 96.86% 96.86% -0.01%  ========================================== Files 20 20 Lines 2741 2740 -1 ========================================== - Hits 2655 2654 -1  Misses 86 86 
Impacted Files Coverage Δ
flask_restx/marshalling.py 98.21% <100.00%> (ø)
flask_restx/api.py 96.75% <0.00%> (-0.01%) ⬇️

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 88497ce...eb274dd. Read the comment docs.

@j5awry
Copy link
Contributor

j5awry commented Aug 16, 2021

LGTM. Can you think of any cases where this could cause a problem? I can't think of any.

@dhanababum
Copy link
Author

Hi @j5awry, Any update on this?

@ziirish ziirish force-pushed the master branch 2 times, most recently from 0db7d06 to 4eaf373 Compare November 1, 2022 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants