* Fix deprecation warning for iter_errors
Bump jsonschema version to at least v4
* Bump jsonschema to v4.0.1
* Provide schema as keyword arg to evolve
* Fix evolve statement
* Fix OpenAPI parameters containing other parameters
OpenAPI parameters can be unspecified and sometimes contain other
parameters. The current behavior is to assume it's a bracket parameter
and nest the containing parameter within the contained parameter, which
breaks the schema as the original parameter now seems to contain a
nested object.
We can avert this by checking for the presence of a '[' in the
parameter.
* Trigger Github workflow
Co-authored-by: Ricardo Piro-Rael <rpiro-rael@ironox.com>
* openapi: remove body preprocessing
Body is already validated using jsonschema. There was also some type
casting but it was wrong: e.g. not recurring deeply into dicts and lists,
relying on existence of "type" in schema (which is not there e.g. if
oneOf is used). Anyway, the only reason why types should be casted is
converting integer values to float if the type is number. But this is in
most cases irrelevant.
Added an example, which did not work before this commit (echoed `{}`)
e.g. for
```
curl localhost:8080/api/foo -H 'content-type: application/json' -d
'{"foo": 1}'
```
but now the example works (echoes `{"foo": 1}`).
* test with oneOf in the requestBody
* remove oneof examples: superseded by tests
Co-authored-by: Pavol Vargovcik <pavol.vargovcik@kiwi.com>
* WIP: rework required_scopes checking
* Update tests for security scopes
* Add test for oauth security scheme with multiple possible scopes
* Update security tests
* Change optional auth test to correct behaviour
* Update security documentation
* Remove TODOs
* Catch possible exceptions from failed checks in async security factory
* Add .venv/ to gitignore
* Try to raise most specific exception
* Add test for raising most specific error
* Update async security handler factory
* Fix security handler error catching
* Fix imports order
* ensure view_name is CamelCase
* update tests for MethodViewResolver for CamelCase
* use inflection package to camelize
Co-authored-by: Robbe Sneyders <robbe.sneyders@ml6.eu>
* Added unit tests to demonstrate the problems of https://github.com/zalando/connexion/issues/975
- Taken mostly from existing PR: https://github.com/zalando/connexion/pull/987
* now splitting out multipart POSTs into files[] and form[], handling duplicate keys as the rest of connexion expects
- Based parly on existing PR: https://github.com/zalando/connexion/pull/987
* rewrote how operations/openapi.py::_get_body_argument() works to better build the arguments[] list according to what the spec says and what the handler accepts. This fixes a bug when requests contain mixed files and form values and the handler is expecting variable names matching the request property names.
* Adding unit tests to improve code converage test
* post merge fixes - using 'async' keyword now in new unit test file
* unit test improvements -- now testing the contents of the files we upload too
* making some code a bit clearer regarding duplicate names of file submissions
* fixing up unit tests since merging main
* fixing isort-check-tests and flake8
* clarified a comment
* comment correction
* after discussions with maintainer, reverted _get_body_argument back to the original where it does not attempt to break out the body into individual arguments for the handler. But left in changes that make the normal behavior of not passing a body argument to a handler without one more consistent when the body itself is empty or not an object type.
* fixing unit tests after after reverting _get_body_argument behavior
* fix-square bracket : V1
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* Fix syntax
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* Add OpenAPI test with square brackets
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* Fix test
Fix alphabetic order in import
Fix test parametrization
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* square bracket : Set collection format to None for OpenAPIURIParser
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
Co-authored-by: Géry THRASIBULE <g.thrasibule@lecomptoirdespharmacies.fr>
* Reload Flask on API file changes
Flask can automatically reload in debug mode whenver specified files
change. By default that includes templates, however changes to the API
files (i.e. openapi.yml) should result in a reload as well.
This PR adds all added API files to be monitored automatically by Flask.
Signed-off-by: Paul Spooren <mail@aparcar.org>
* Take into account specification dir
* Add extra_files argument.
User can still specify custom extra_files in addition to the
swagger specification, so need to account for that in FlaskApp.run().
* Update docstring for flake8
* Add extra_files as explicit argument for FlaskApp
* Add extra_files docstring
Co-authored-by: Ruwan <ruwanlambrichts@gmail.com>
* Add test for incorrectly cased params with pythonic_params
* Fix 1307: only sanitize when checking view func arguments
* Don't sanitize original request form
* Fix OpenAPI3 test fixture for form data
* Fix view function for test
* Drop usage of private jsonschema modules
* Bump upper boundry for jsonschema version to 5.0.0
* Create validate_defaults function by passing in the instance_validator
The instance_validator was previously set as an attribute on the
OpenApiValidator. However with the jsonschema upgrade to 4.0.0, this
attribute is no longer maintained while descending into the spec.
Presumably because jsonschema now relies on attrs.resolve.
* Add a relative resolver
* Fix super() usage
* Apply suggestions from code review
* Allow root_path to be a Python module
* Expand documentation for RelativeResolver
* Add tests for relative resolver
* #1424: add keywords to the list of pythonic words
* reorder imports
* add test query parameter
* add test query parameter "class"
* add class query param to test
* add class query param to openapi spec
* Update connexion/decorators/parameter.py
Co-authored-by: Ruwann <ruwan.lambrichts@ml6.eu>
Co-authored-by: Ruwann <ruwan.lambrichts@ml6.eu>
* jsonschema validation
* doh, exceptions should be raised
* internalize OpenAPI specs
from 6d17b631ff
* enforce that each default value validates against the schema in which it resides
* Fix import order
* Remove unused imports
* Move _validate_spec() to Specification base class
Co-authored-by: Patrick Wang <patrickkwang@users.noreply.github.com>