-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Use strict API schemas #9365
Use strict API schemas #9365
Conversation
Nice! |
I also suggest we enable strict validation here: airflow/www/extensions/init_views.py. It's currently disabled
|
@ephraimbuddy Good point. I will do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't this issue fixed marshmallow-code/marshmallow#377 by marshmallow-code/marshmallow#711 ?
@kaxil No. This has only changed in 3.0. We use marshmallow 2.*. |
How about using something like since we would always want the class Schema(marshmallow.Schema):
def __init__(self, strict=True, **kwargs):
super().__init__(strict=strict, **kwargs) |
@kaxil This will complicate reviews because we will have to check imports. I do not see the problem that the code is repeated, because it is only one option.
|
Some Schemas uses SQLALchemySchema from marshmallow_sqlalchemy |
We will have to remove all the class that inherits then :D We can call it Then main reason I recommended that was to enforce that we always use Anyways @ephraimbuddy makes a good point that we use SQLALchemySchema at some places. So let's keep it as it is. ✅ |
The rules are already verified by connexion, but it's still worth forcing some unexpected errors to not be accidentally ignored.
CC: @ephraimbuddy
Make sure to mark the boxes below before creating PR: [x]
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.