-
-
Notifications
You must be signed in to change notification settings - Fork 769
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 Operation into AbstractOperation and Swagger2Operation #639
Conversation
Landing #641 should make this diff a little smaller. |
b891e8e
to
1a11cc6
Compare
02c03d0
to
edfe260
Compare
@dtkav can you resolve the conflicts? |
9ddd931
to
2eba7bc
Compare
I thought of another way to slim down this PR. I'll put up a PR that is just the change from |
2eba7bc
to
2fb2a90
Compare
tests/api/test_bootstrap.py
Outdated
@@ -41,10 +41,10 @@ def test_app_with_different_server_option(simple_api_spec_dir, spec): | |||
|
|||
|
|||
def test_app_with_different_uri_parser(simple_api_spec_dir): | |||
from connexion.decorators.uri_parsing import Swagger2URIParser |
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.
I'll factor this out into a separate PR
2fb2a90
to
f97a7a4
Compare
#653 will make this smaller (factors out switch to openapi_spec_validator) |
50c453f
to
653745b
Compare
653745b
to
d25f6b6
Compare
34ef804
to
a514e56
Compare
@@ -0,0 +1,291 @@ | |||
import logging |
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.
Curious, was this just stripped out from an older file into its own file to ensure backwards compatibility?
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.
Yup, the swagger2.py file is for backwards compatibility with the swagger2 spec. The idea with this PR is to create an Abstract Base Class (abc), which is essentially the interface that describe what an "Operation" is. Previously we only had one implementation of this interface (swagger 2 Operation), so it wasn't well defined. Now, after this refactor, the OpenAPIOperation can implement the exact same interface as a Swagger2Operation. Together they encapsulate the differences between the Swagger2 spec and the OpenAPI3 spec. Hope that makes sense.
👍 |
…-first#639) * refactor Operation into AbstractOperation ABC and SwaggerOperation * remove defaults validation from swagger2.py (now handled in validator) * update README 'new in 2.0' section
Relates to #420
In an attempt to break up the OpenAPI3 PR, this includes all of the refactor that went into that branch, but leaves out other openapi3 support.
Changes proposed in this pull request:
Plan for OpenAPI integration:
Once this is merged, the OAS3 branch should basically contain