Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
eb374a6
Remove vendored swagger-ui, add swagger-ui-bundle as optional pip ext…
dtkav Jul 10, 2018
c9fdb5d
remove old_style_options from app and api
Jul 11, 2018
980b8f1
remove test for warning which has been removed
Jul 11, 2018
5ec6284
fix up some tests
Jul 11, 2018
b280d31
fix up tests, document changes in readme
Jul 11, 2018
fea2611
isort
Jul 12, 2018
3b9ad6a
Merge branch 'master' into dev-2.0
jmcs Jul 13, 2018
5e7479d
Fix code style issue
jmcs Jul 13, 2018
07c32dd
use general-purpose recursive resolver
Jul 16, 2018
7fab8a7
remove impossible case of reference resolution failing after validation
Jul 19, 2018
b39a861
only rely on jsconschema resolver
Jul 23, 2018
ff0e378
bring back local resolution with deep_get
Jul 23, 2018
d7b71bb
add x-nullable support for body validators
Jul 25, 2018
457d7a8
Merge branch 'master' of https://github.com/zalando/connexion into nu…
Jul 26, 2018
cd9f7b4
remove ref resolution from mock code
Jul 27, 2018
ec9b52a
parameterize tests in prep for OpenAPI3 support
Jul 26, 2018
083c4d4
remove bad test that relies on logging
Jul 26, 2018
95dcefe
Rename Operation to Swagger2Operation
Jul 30, 2018
dbe7061
isort
Aug 1, 2018
231fbb0
add Operation for backwards compatability
Aug 2, 2018
9964cac
increase coverage for utils.py
Jul 26, 2018
93049f4
add pragma: no cover to some __repr__ functions
Jul 30, 2018
ae6bba6
default to Swagger2URIParser
Aug 2, 2018
e56ff62
kick build
Aug 3, 2018
d248434
add check for Iterable
Aug 7, 2018
a17f822
switch from swagger_spec_validator to openapi_spec_validator library
Aug 2, 2018
df0fb0c
update README.md 'new in 2.0' section
Aug 2, 2018
646517f
remove accidental empty file
Aug 7, 2018
deb5104
update README to include information about exceptions
Aug 7, 2018
bce4530
remove logging openapi spec version
Aug 7, 2018
40c1c5a
Wrap OpenAPIValidationError exceptions with InvalidSpecification
Aug 7, 2018
97148ce
use verbose logging from ValidationError
Aug 7, 2018
b2eff6f
rely on ValidationError methods
Aug 7, 2018
b6edbf9
isort
Aug 7, 2018
614c1bc
update some names from swagger to openapi
Aug 8, 2018
fb28646
add options.py changes
Aug 8, 2018
7ce302d
update aio test to compare against raw_spec
Aug 8, 2018
5992012
rename 'swagger_json' option to 'serve_spec', add deprecation warning
Aug 8, 2018
29a5364
add override if UI is enabled
Aug 8, 2018
077a795
disable and remove comment about swagger_json override behavior
Aug 9, 2018
167df58
fix the way cli.py passes options
dtkav Aug 7, 2018
07bcd0e
Merge pull request #656 from dtkav/fix_cli
dtkav Aug 23, 2018
99ac95f
Refactor Operation into AbstractOperation and Swagger2Operation (#639)
dtkav Aug 23, 2018
ca1607a
Merge branch 'master' into dev-2.0
dtkav Aug 24, 2018
18de95e
fix form defaults, and form array handling
dtkav Aug 27, 2018
cd2b8e4
Merge pull request #668 from dtkav/fix_forms
dtkav Aug 27, 2018
86b5059
Merge pull request #669 from dmksnnk/nullable-in-definitions
dtkav Aug 29, 2018
32a9ca5
Merge branch 'master' into dev-2.0
dtkav Sep 3, 2018
98957d5
refactor Operation into AbstractOperation ABC and SwaggerOperation
dtkav Jul 23, 2018
62c4cd5
remove defaults validation from swagger2.py (now handled in validator)
dtkav Aug 8, 2018
602d329
remove unused/uncovered code
dtkav Aug 10, 2018
5feaf3f
use external swagger_ui_bundle package, remove vendored files
dtkav Jul 2, 2018
b15ffce
initial support for oas3
dtkav Jul 2, 2018
d263417
Merge pull request #621 from dtkav/oas3
dtkav Sep 11, 2018
f1f1e9b
Merge branch 'master' into dev-2.0
dtkav Sep 12, 2018
f6ea055
servers is not a requried field in oas3 spec
dtkav Sep 12, 2018
e09f976
move swagger2 examples under swagger2 folder
dtkav Sep 12, 2018
5ca46e2
Merge pull request #676 from dtkav/bugfix_no_oas3_server
dtkav Sep 12, 2018
024edd1
Merge pull request #677 from dtkav/swagger2_examples
dtkav Sep 12, 2018
602924b
add oas3 examples
dtkav Jul 11, 2018
d093225
Merge pull request #622 from dtkav/oas3_examples
dtkav Sep 13, 2018
4ebc580
Codacy fixes (#680)
dtkav Sep 13, 2018
7b01efd
skip codacy warnings about the use of assert in unit tests (#679)
dtkav Sep 13, 2018
35e4e67
rely on openapi-spec-validator to safely load and resolve yaml files …
dtkav Sep 14, 2018
d5f15e5
Change nullable handling, add support for readOnly/writeOnly keyword
cziebuhr Sep 18, 2018
b4abfc3
Set validator_map per api
cziebuhr Sep 14, 2018
8e38cc2
Allow setting validator on ResponseValidator
cziebuhr Sep 14, 2018
3dcba08
Add more tests for validator_map and readOnly/writeOnly
cziebuhr Sep 18, 2018
08fa18f
Merge pull request #684 from cziebuhr/nullable
dtkav Sep 20, 2018
6258264
Merge branch 'master' into dev-2.0
dtkav Sep 20, 2018
28893a0
add support for x-openapi-router-controller
dtkav Sep 20, 2018
039dc62
update README
dtkav Sep 20, 2018
6aafd33
set _router_controller before calling AbstractOperation.__init__(...)
dtkav Sep 20, 2018
96fad89
update tests
dtkav Sep 20, 2018
16e16c3
Merge pull request #688 from dtkav/openapi-router-controller
dtkav Sep 21, 2018
5f85bc3
Merge branch 'master' into dev-2.0
jmcs Sep 27, 2018
e2fefb0
Update docs/examples for validator_map (#700)
cziebuhr Sep 28, 2018
ed6535e
Rework security flow (#686)
cziebuhr Sep 28, 2018
8e00b73
Setting base_path updates served spec (#698)
dtkav Sep 30, 2018
0ac8c42
set jsonschema max version
dtkav Oct 3, 2018
e83bd14
Merge pull request #708 from dtkav/jsonschema_max_version
dtkav Oct 4, 2018
069c59b
bugfix: get securitySchemes in openapi 3 APIs (#712)
dtkav Oct 5, 2018
b6e81ca
Introduce Specification classes
dtkav Oct 8, 2018
769b355
fix aiohttp test
dtkav Oct 8, 2018
577451f
remove some api properties
dtkav Oct 8, 2018
1b757e5
remove assert from testing
dtkav Oct 8, 2018
745a4ac
rename spec from_file to load
dtkav Oct 18, 2018
f2cbed1
Merge pull request #713 from dtkav/spec_class
dtkav Oct 18, 2018
48524ec
Fix new errors from Flake8 update
dtkav Oct 27, 2018
0545ad1
Merge pull request #736 from dtkav/flake8_errors
dtkav Oct 27, 2018
920f13d
Merge remote-tracking branch 'origin/master' into dev-2.0
jmcs Oct 29, 2018
6bcf2b3
Add App(resolver=...) for app-wide default resolver (#735)
dtkav Oct 29, 2018
63138c4
swagger-ui README section passes options instead of kwargs (#743)
dtkav Nov 1, 2018
de853d4
Make readme pass pypi checks
jmcs Nov 5, 2018
e67c646
Update introduction
jmcs Nov 5, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove old_style_options from app and api
  • Loading branch information
Daniel Grossmann-Kavanagh authored and jmcs committed Jul 12, 2018
commit c9fdb5d4499f5366cba942732a3ebe2e482f66fd
13 changes: 2 additions & 11 deletions connexion/apis/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class AbstractAPI(object):
def __init__(self, specification, base_path=None, arguments=None,
validate_responses=False, strict_validation=False, resolver=None,
auth_all_paths=False, debug=False, resolver_error_handler=None,
validator_map=None, pythonic_params=False, options=None, **old_style_options):
validator_map=None, pythonic_params=False, options=None):
"""
:type specification: pathlib.Path | dict
:type base_path: str | None
Expand All @@ -60,21 +60,12 @@ def __init__(self, specification, base_path=None, arguments=None,
:type pythonic_params: bool
:param options: New style options dictionary.
:type options: dict | None
:param old_style_options: Old style options support for backward compatibility. Preference is
what is defined in `options` parameter.
"""
self.debug = debug
self.validator_map = validator_map
self.resolver_error_handler = resolver_error_handler

self.options = ConnexionOptions(old_style_options)
# options is added last to preserve the highest priority
self.options = self.options.extend(options)

# TODO: Remove this in later versions (Current version is 1.1.9)
if base_path is None and 'base_url' in old_style_options:
base_path = old_style_options['base_url']
logger.warning("Parameter base_url should be no longer used. Use base_path instead.")
self.options = ConnexionOptions(options)

logger.debug('Loading specification: %s', specification,
extra={'swagger_yaml': specification,
Expand Down
18 changes: 4 additions & 14 deletions connexion/apps/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class AbstractApp(object):
def __init__(self, import_name, api_cls, port=None, specification_dir='',
host=None, server=None, arguments=None, auth_all_paths=False, debug=False,
validator_map=None, options=None, **old_style_options):
validator_map=None, options=None):
"""
:param import_name: the name of the application package
:type import_name: str
Expand Down Expand Up @@ -47,9 +47,7 @@ def __init__(self, import_name, api_cls, port=None, specification_dir='',
self.auth_all_paths = auth_all_paths
self.validator_map = validator_map

self.options = ConnexionOptions(old_style_options)
# options is added last to preserve the highest priority
self.options = self.options.extend(options) # type: ConnexionOptions
self.options = ConnexionOptions(options)

self.app = self.create_app()
self.server = server
Expand Down Expand Up @@ -90,7 +88,7 @@ def set_errors_handlers(self):
def add_api(self, specification, base_path=None, arguments=None,
auth_all_paths=None, validate_responses=False,
strict_validation=False, resolver=Resolver(), resolver_error=None,
pythonic_params=False, options=None, **old_style_options):
pythonic_params=False, options=None):
"""
Adds an API to the application based on a swagger file or API dict

Expand All @@ -115,9 +113,6 @@ def add_api(self, specification, base_path=None, arguments=None,
:type pythonic_params: bool
:param options: New style options dictionary.
:type options: dict | None
:param old_style_options: Old style options support for backward compatibility. Preference is
what is defined in `options` parameter.
:type old_style_options: dict
:rtype: AbstractAPI
"""
# Turn the resolver_error code into a handler object
Expand All @@ -138,12 +133,7 @@ def add_api(self, specification, base_path=None, arguments=None,
else:
specification = self.specification_dir / specification

# Old style options have higher priority compared to the already
# defined options in the App class
api_options = self.options.extend(old_style_options)

# locally defined options are added last to preserve highest priority
api_options = api_options.extend(options)
api_options = self.options.extend(options)

api = self.api_cls(specification,
base_path=base_path,
Expand Down