Skip to content

Import and rename decorators from Marshmallow#43

Merged
greyli merged 2 commits intomasterfrom
ma-decorators
May 11, 2021
Merged

Import and rename decorators from Marshmallow#43
greyli merged 2 commits intomasterfrom
ma-decorators

Conversation

@greyli
Copy link
Copy Markdown
Member

@greyli greyli commented May 11, 2021

Rename the following decorators from Marshmallow:

  • pre_load -> before_load
  • post_load -> after_load
  • pre_dump -> before_dump
  • post_dump -> after_dump
  • validates -> validate
  • validates_schema -> validate_schema

Not sure if it's a good idea, but this is definitely what I want to do. The four hooks are changed to match the naming style in Flask (i.e., before_request, after_request, etc.). The validates -> validate change meant to make the names more simple.

This change will introduce an API difference between APIFlask and Marshmallow, I will address these changes at the beginning of the schema docs (working in progress).

@netlify
Copy link
Copy Markdown

netlify bot commented May 11, 2021

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #43 (f0428b7) into master (a4400ea) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #43   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           14        14           
  Lines          798       805    +7     
  Branches       147       147           
=========================================
+ Hits           798       805    +7     
Impacted Files Coverage Δ
apiflask/__init__.py 100.00% <100.00%> (ø)
apiflask/app.py 100.00% <100.00%> (ø)
apiflask/decorators.py 100.00% <100.00%> (ø)
apiflask/exceptions.py 100.00% <100.00%> (ø)
apiflask/security.py 100.00% <100.00%> (ø)

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 a4400ea...f0428b7. Read the comment docs.

@greyli greyli merged commit a97588a into master May 11, 2021
@greyli greyli deleted the ma-decorators branch May 11, 2021 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants