Skip to content
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

Support apispec >= 4 #206

Merged
merged 7 commits into from
Oct 25, 2020
Merged

Support apispec >= 4 #206

merged 7 commits into from
Oct 25, 2020

Conversation

kam193
Copy link
Contributor

@kam193 kam193 commented Oct 11, 2020

This PR introduce support for compatibility-breaking apispec 4.0.0. Since some interface and argument names are changed, I decided to drop support for older apispec. Switching to apispec 4 may require some changes in code (see https://github.com/marshmallow-code/apispec/blob/dev/CHANGELOG.rst).

Behavior of fields2parameters is now handled directly by flask-apispec: old method no longer exists and new 'official' way, converting to Schema, when fields should be in body conflicts with flask-apispec behavior (it generates reference to named schema instead of putting just dict with definition and registers new schema every time converted, so output can contain multiple schemas; in addition, there is a problem with names for multiple auto-generated schemas).

I strongly recommend making a recovery release with apispec pined to < 4 (PR #204) for those, who would keep on it, before merging my changes.

Fix #202

1. Rename 'default_in'
(marshmallow-code/apispec#526)
2. Dict schema: convert it to object and handle special case 'body',
since prior used method no longer exists
(marshmallow-code/apispec#581)
Supporting different apispec version requires
different logic for each of them. New apispec
requires Python >= 3.6
@codecov-io
Copy link

Codecov Report

Merging #206 into master will increase coverage by 0.59%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #206      +/-   ##
==========================================
+ Coverage   97.26%   97.86%   +0.59%     
==========================================
  Files           8        8              
  Lines         366      374       +8     
==========================================
+ Hits          356      366      +10     
+ Misses         10        8       -2     
Impacted Files Coverage Δ
flask_apispec/apidoc.py 97.67% <100.00%> (+2.80%) ⬆️

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 4c3cabe...866aed3. Read the comment docs.

@kam193 kam193 mentioned this pull request Oct 11, 2020
@sloria
Copy link
Collaborator

sloria commented Oct 23, 2020

Apologies for the delay. I'll try to look at this soon

@sloria sloria merged commit 3f65753 into jmcarp:master Oct 25, 2020
@sloria
Copy link
Collaborator

sloria commented Oct 25, 2020

This is released in 0.11.0. Thanks for the PR!

@kam193
Copy link
Contributor Author

kam193 commented Oct 26, 2020

Thank you for the help!

jollysahil pushed a commit to levrofin/flask-apispec that referenced this pull request Sep 12, 2023
* Compatibility with apispec 4

1. Rename 'default_in'
(marshmallow-code/apispec#526)
2. Dict schema: convert it to object and handle special case 'body',
since prior used method no longer exists
(marshmallow-code/apispec#581)

* Drop support for apispec < 4, Python < 3.6

Supporting different apispec version requires
different logic for each of them. New apispec
requires Python >= 3.6

* Remove unused imports

* Update tox.ini

* Update changelog

* Drop Python 3.5 support

apispec no longer supports 3.5

Co-authored-by: Steven Loria <sloria1@gmail.com>
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.

apispec 4.0.0
3 participants