-
Notifications
You must be signed in to change notification settings - Fork 914
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
Marshmallow3 support #353
Merged
cript0nauta
merged 31 commits into
infobyte:master
from
cript0nauta:marshmallow3-support
May 27, 2020
Merged
Marshmallow3 support #353
cript0nauta
merged 31 commits into
infobyte:master
from
cript0nauta:marshmallow3-support
May 27, 2020
Conversation
This file contains 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
I based on http://marshmallow.readthedocs.io/en/latest/upgrading.html#upgrading The two items mentioned there were broking most of the app, fixed them so only a few tests break
The commit d5cab0ef11ce130d58a3aafc4eb7f163e34a9543 of marshmallow broke my custom field. (Thanks git bisect!). See also: marshmallow-code/marshmallow#809 marshmallow-code/marshmallow#810
Commit 7873207314cc36097db56912069a0a84d1a20de1 of marshmallow broke my code. See also: marshmallow-code/marshmallow#378 marshmallow-code/marshmallow#756
This broke the vuln api in new marshmallow versions. This fix might broke the compatibility web, but at least the tests pass.
Commit 43e8b466dd9e3bf1f1d1f4b43d143f42afcddd79 of marshmallow broke our code See also: marshmallow-code/marshmallow#347 marshmallow-code/marshmallow#819 https://marshmallow.readthedocs.io/en/3.0/upgrading.html#pre-post-processors-must-return-modified-data
Commit cc17b49534bec5777a7618fc0a64201addbc0c50 of marshmallow broke our code See also: https://marshmallow.readthedocs.io/en/3.0/upgrading.html#schemas-raise-validationerror-when-deserializing-data-with-unknown-keys marshmallow-code/marshmallow#851 marshmallow-code/marshmallow#872
This should be done in commit c88ab77 but I forgot to change it
Tag White v3.7.2 Fix in pink and black
rc5 changed the error messages so a few tests broke because of that
Closed
To use marshmallow 3 Command run: pypi2nixpkgs --nixpkgs https://github.com/nixos/nixpkgs/archive/91c43a9dc822da30cf3cd2908891edddcea482f2.tar.gz --local faradaysec 'pytest-factoryboy>=2.0.1'
- print without parens (this was python 2 code) - Usage of strict=True (not valid anymore in marshmallow 3) - Usage of both missing and required=True in a schema (this didn't make sense) Now all tests are running, but most are failing
Allow passing strict=True to AutoSchema, even if it's a useless argument. And fix bugs with schemas that weren't based on AutoSchema
It was duplicated with the "query" field and this caused marshmallow to fail when filtering. Disable that field until we find a solution for this.
Add a compatibility layer in AutoSchema to be able to use the .data of the result of dump and load. Remove .data access manually in non AutoSchema based schemas.
It was not compatible with marshmallow 3 because it was returning None: "In marshmallow 2.x, None returned by a pre or post-processor is interpreted as “the data was mutated”. In marshmallow 3.x, the return value is considered as processed data even if it is None."
I didn't note this because the ReportProcessor runs in a thread inside the tests, so it didn't directly raise an exception (but it was logged)
I forgot to use bytes instead of str when resolving a merge conflict
* Add `**kwargs` to decorated schema methods, as detailed in https://marshmallow.readthedocs.io/en/stable/changelog.html#rc7-2019-06-15 * Add `**kwargs` to `_deserialize` method of custom fields, as detailed in https://marshmallow.readthedocs.io/en/stable/upgrading.html#custom-fields * Upgrade marshmallow-sqlalchemy because 0.15.0 is not compatible with this marshmallow version. (Note: I'm ignoring the problem described in #5687) * Don't use marshmallow.compat. It was designed for python 2/3 compatibility and was removed in 3.0.0rc7 * Fix a strange bug when using PolymorphicVulnerabilityField * Use keyword-only arguments instead of positional arguments when needed
I needed to add a horrible hack to maintain backwards compatibility in the API DateTime fields. I prefer to have this horrible thing but ensure our API works in the same way as before.
The vulns API must accept query_string and query, params and parameters, etc.
Because of the DictWithData hack, a piece of code got the vuln data field instead of the full JSON with all vuln fields. Note: this bug only happened in our commercial versions, not in community.
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.
This change makes Faraday use marshmallow 3 instead of the old marshmallow 2