Commit graph

270 commits

Author SHA1 Message Date
p1c2u
48ee8f9f87 Validation result datatypes and tests restructure 2019-10-19 10:55:32 +01:00
A
f12b6d8445
Merge pull request #161 from p1c2u/feature/setup-config-refactor
Setup config file
2019-10-16 20:50:20 +01:00
p1c2u
ffce1ab2de Makefile added 2019-10-16 20:29:46 +01:00
p1c2u
4f486c2bc6 Setup config refactor 2019-10-16 20:28:37 +01:00
p1c2u
df5fbe7c2a bumpversion config 2019-09-21 20:29:44 +01:00
p1c2u
aa78985348 Version 0.12.0 2019-09-21 20:07:04 +01:00
A
4690f77c09
Merge pull request #157 from p1c2u/feature/validation-refactor
OAS validation with JSONSchema
2019-09-13 10:13:18 +01:00
p1c2u
fc60083e78 Get rid of schema validation in unmarshal 2019-09-13 01:55:22 +01:00
p1c2u
a2fc5284c6 Get rid of object validator 2019-09-12 19:56:39 +01:00
p1c2u
b2410e2f3a OAS 3.0 validator 2019-09-12 19:46:11 +01:00
p1c2u
c4c51637d2 Rename schema validate to obj_validate 2019-09-12 19:46:11 +01:00
p1c2u
f414b182c8 Version 0.11.1 2019-09-07 13:03:58 +01:00
A
843fa7e7ca
Merge pull request #156 from p1c2u/feature/separate-parameter-cast-and-unmarshal
Separate cast and unmarshal
2019-09-03 17:30:01 +01:00
p1c2u
5273a7ff7c Separate cast and unmarshal 2019-09-02 23:48:13 +01:00
A
0e30b71a77
Merge pull request #145 from gweis/path-parameter-override
very simple and hacky path item parameter override test
2019-06-20 16:34:03 +01:00
Gerhard Weis
3d23f17c1d add test to check parameter uniqueness is handled correctly in validator 2019-06-20 06:38:00 +10:00
Gerhard Weis
d490d5774b fix path parameter validation when overridden on operation 2019-06-20 06:23:54 +10:00
Gerhard Weis
a8248a53da parameters are unique as long as name and location are unique. 2019-06-20 05:09:33 +10:00
Gerhard Weis
a1dfaf6adb make flake8 happy 2019-06-19 08:59:50 +10:00
Gerhard Weis
a8d7d9b9dc very simple and hacky path item parameter override test 2019-06-19 08:49:03 +10:00
p1c2u
4ac4baf710 Version 0.11.0 2019-06-18 22:42:44 +01:00
A
ff5f018e26
Merge pull request #144 from p1c2u/fix/parameters-on-path-item-object
Parameters on path item object support
2019-06-18 22:32:52 +01:00
Artur Maciag
e8d98dfdf7 TestPathItemParamsValidator linting fix 2019-06-18 16:35:45 +01:00
Artur Maciag
27ebae3182 Parameters on path item object support 2019-06-18 16:31:42 +01:00
Gerhard Weis
40944119d1 add failing test for parameters on path item object 2019-06-18 15:42:19 +01:00
A
83456ee666
Merge pull request #143 from p1c2u/fix/attr-errors-hashable-fix
attr errors hashable fix
2019-06-18 15:24:21 +01:00
Artur Maciag
c9b2d8c4f8 attr errors hashable fix 2019-06-18 14:54:02 +01:00
A
78ede74825
Merge pull request #138 from p1c2u/feature/primitive-types-unmarshallers
Primitive types unmarshallers
2019-06-17 16:52:03 +01:00
Artur Maciag
9d9629b4bd Primitive types unmarshallers 2019-06-17 16:24:46 +01:00
A
9376b2e2da
Merge pull request #141 from bjmc/flask_params
Modify FlaskOpenAPIRequest to accomodate path variables
2019-06-17 15:38:45 +01:00
A
0df1d051b4
Merge pull request #133 from crunchr/support-any-type-with-one-of-rb1
Add support for one-of with any type
2019-06-17 13:28:41 +01:00
Brendan McCollam
3093364304 PEP8 2019-06-12 12:16:55 +01:00
Brendan McCollam
2908015745 Adds test for request validator w/Flask wrapper
formatting
2019-06-12 12:16:55 +01:00
Brendan McCollam
934550324e Fix pre-existing test 2019-06-12 12:16:55 +01:00
Brendan McCollam
3ef0c6adcf Convert Flask path variables to OpenAPI path parameters 2019-06-12 12:16:55 +01:00
Brendan McCollam
2ec02e473e Adds failing test
Adds flask_wrapper.yaml spec
2019-06-12 11:37:10 +01:00
Daniel Bradburn
a1596ea8c3 remove unused import 2019-06-08 11:21:59 +02:00
Daniel Bradburn
d742a03f0f remove unused import 2019-06-08 11:03:58 +02:00
A
4874851054
Merge pull request #136 from badcure/remove_py34
Removing Python 3.4 from testing. It is no longer supported.
2019-05-22 09:06:17 +01:00
Artur Maciag
b284191eeb End of Python 3.4 support 2019-05-22 08:57:27 +01:00
brian.price
80668ce1da Removing Python 3.4 from testing. It is no longer supported. 2019-05-21 18:05:58 -05:00
Artur Maciag
75840e0a95 Version 0.10.0 2019-05-21 13:21:42 +01:00
A
98f72bff1b
Merge pull request #134 from dz0ny/fix/number_parsing
Fix number validator
2019-05-21 13:19:07 +01:00
Artur Maciag
63f3ffb09f Number format added 2019-05-21 12:54:13 +01:00
A
f0cfa2d0e0
Merge pull request #131 from MCapitani/links
add support for "links" in Response
2019-05-21 12:26:32 +01:00
A
f5d26112b2
Merge pull request #130 from MCapitani/add-path-param
add support for path-level parameters
2019-05-17 10:30:51 +01:00
A
391d664dac
Merge pull request #132 from niteoweb/fix/password_format
Add support for `password` string format
2019-05-17 10:28:07 +01:00
Janez Troha
3339e1311a Fix number validator
The `integer_types` is always a tuple. When checking
if an instance is a number it fails because it's doing a comparison against a tuple
instead of real type.

➜ python -c "from six import integer_types;import sys;print(integer_types);print(sys.version)"
(<type 'int'>, <type 'long'>)
2.7.16 (default, Apr  6 2019, 01:42:57)
[GCC 8.3.0]

➜ python3 -c "from six import integer_types;import sys;print(integer_types);print(sys.version)"
(<class 'int'>,)
3.7.3 (default, Apr  3 2019, 05:39:12)
[GCC 8.3.0]

And spec defines a number as both int and float https://swagger.io/docs/specification/data-models/data-types/#numbers so both validators need to support both types.
2019-05-15 19:00:38 +02:00
Daniel Bradburn
7d903a8907 Add support for one-of with any type 2019-05-02 15:50:38 +02:00
Nejc Zupan
13e65a2d91 Add missing STRING_FORMAT_CALLABLE_GETTER: SchemaFormat.PASSWORD
`password` is a valid OpenAPIv3 string format, that is used as a UI hint
for frontend clients to mask the input field.

It was already present in the `SchemaFormat` enum, but it was not
handled in `_unmarshal_string` that uses `STRING_FORMAT_CALLABLE_GETTER`
to decide how to unmarshal a string, which would result in an error like
this one:

```
Traceback (most recent call last):
  [... snip ...]
  File ".venv/lib/python3.7/site-packages/openapi_core/validation/request/validators.py", line 37, in validate
    body, body_errors = self._get_body(request, operation)
  File ".venv/lib/python3.7/site-packages/openapi_core/validation/request/validators.py", line 82, in _get_body
    body = media_type.unmarshal(raw_body, self.custom_formatters)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/media_types/models.py", line 45, in unmarshal
    unmarshalled = self.schema.unmarshal(deserialized, custom_formatters=custom_formatters)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/schemas/models.py", line 189, in unmarshal
    casted = self.cast(value, custom_formatters=custom_formatters, strict=strict)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/schemas/models.py", line 179, in cast
    return cast_callable(value)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/schemas/models.py", line 295, in _unmarshal_object
    value, custom_formatters=custom_formatters)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/schemas/models.py", line 335, in _unmarshal_properties
    prop_value, custom_formatters=custom_formatters)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/schemas/models.py", line 189, in unmarshal
    casted = self.cast(value, custom_formatters=custom_formatters, strict=strict)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/schemas/models.py", line 179, in cast
    return cast_callable(value)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/schemas/models.py", line 295, in _unmarshal_object
    value, custom_formatters=custom_formatters)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/schemas/models.py", line 335, in _unmarshal_properties
    prop_value, custom_formatters=custom_formatters)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/schemas/models.py", line 189, in unmarshal
    casted = self.cast(value, custom_formatters=custom_formatters, strict=strict)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/schemas/models.py", line 179, in cast
    return cast_callable(value)
  File ".venv/lib/python3.7/site-packages/openapi_core/schema/schemas/models.py", line 215, in _unmarshal_string
    formatstring = self.STRING_FORMAT_CALLABLE_GETTER[schema_format]
KeyError: <SchemaFormat.PASSWORD: 'password'>
```
2019-04-26 20:22:54 +01:00