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

Refactor openapi converter #581

Merged
merged 8 commits into from
Aug 31, 2020
Merged

Refactor openapi converter #581

merged 8 commits into from
Aug 31, 2020

Conversation

lafrech
Copy link
Member

@lafrech lafrech commented Jul 10, 2020

Based on #526.

Implements refactor discussed in #500 and #526.

I did not address handling webargs field dicts (#500 (comment)). It can be done later anytime (perhaps easier once MA2 is dropped).

Once #526 is merged, I can rebase this for a clearer diff.

@lafrech lafrech added this to the 4.0 milestone Jul 10, 2020
This was referenced Jul 10, 2020
@lafrech lafrech requested a review from Bangertm July 11, 2020 00:02
Copy link
Collaborator

@Bangertm Bangertm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good. Really cleans up these methods.

src/apispec/ext/marshmallow/openapi.py Outdated Show resolved Hide resolved
src/apispec/ext/marshmallow/openapi.py Outdated Show resolved Hide resolved
name="body",
required=False,
description=None
self, schema, *, location, name="body", required=False, description=None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm torn about what to do with the name parameter. It's only used when location=="body" and it's default value is tied to that case - I presume to guarantee a valid parameter object if the user doesn't enter anything. Seems like it's adding a little extra confusion to this method but I'm not sure anything better can be done.

src/apispec/ext/marshmallow/openapi.py Show resolved Hide resolved
@lafrech
Copy link
Member Author

lafrech commented Jul 22, 2020

Thanks @Bangertm for taking the time to review this.

I think I'm gonna merge this and open an issue about the location mapping.

@lafrech lafrech merged commit d60ac66 into dev Aug 31, 2020
@lafrech lafrech deleted the refactor_openapi_converter branch August 31, 2020 09:53
kam193 added a commit to kam193/flask-apispec that referenced this pull request Oct 11, 2020
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)
sloria added a commit to jmcarp/flask-apispec that referenced this pull request Oct 25, 2020
* 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>
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.

None yet

2 participants