-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Add skip_defaults support for path operations (for #242) #248
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
Conversation
Running into trouble getting skip_defaults passed correctly. I’m not understanding the full flow of the logic from the route decorators to the response serialization.
This is a Starlette class which has include_in_schema but does not have skip_defaults - how do we handle this? Do we need to?
# From routing.py - line 331
elif isinstance(route, routing.Route):
self.add_route(
prefix + route.path,
route.endpoint,
methods=route.methods,
include_in_schema=route.include_in_schema,
name=route.name,
)
Not completely sure I'm handling passing skip_defaults through get_app correctly.
Haven't done any websocket work - not sure if websocket route needs to be handled for this (probably so)
Codecov Report
@@ Coverage Diff @@
## master #248 +/- ##
======================================
Coverage 100% 100%
======================================
Files 177 183 +6
Lines 4327 4539 +212
======================================
+ Hits 4327 4539 +212
Continue to review full report at Codecov.
|
|
Thanks @wshayes ! I'll check it soon. |
Use tutorial examples for testing
|
Thank you @wshayes ! I updated it a bit, added docs, tests, etc. I renamed the parameter to Although I think it's too long, I think we can start with a "too long" completely explicit version and then update it to a shorter version, like The updated docs are here: https://fastapi.tiangolo.com/tutorial/response-model/#response-model-encoding-parameters It will be included in the next release. Thanks! 🎉 🚀 🍰 |
|
Thank you - sorry I couldn't complete it on my own. Very nice job with the documentation. I'll study the changes you made so I can understand the flow better. |
|
Thanks for starting it @wshayes ! |
Running into trouble getting skip_defaults passed correctly. I’m not understanding the full flow of the logic from the route decorators to the response serialization.
This is a Starlette class which has include_in_schema but does not have skip_defaults - how do we handle this? Do we need to?
Haven't done any websocket work - not sure if websocket route needs to be handled for this (probably does)
I would appreciate pointers/help to finish this PR.