Commit graph

86 commits

Author SHA1 Message Date
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
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
Artur Maciag
4d99cbe7e1 Move additional props check to separate method 2019-03-26 13:27:44 +00:00
Diogo Baeder de Paula Pinto
14196b6ce1 Fix #124: Fixing test for Python 2. 2019-03-26 03:41:14 -03:00
Diogo Baeder de Paula Pinto
b029066add Fix #124: Checking "additionalProperties" in "oneOf" items.
This is important because it does the correct validation over items that
are restricted in "oneOf", so that it's possible to use schemas that are
superset of one another as items of "oneOf".
2019-03-26 02:30:07 -03:00
Artur Maciąg
f8e4e34e39 String byte format fix 2019-03-22 14:35:12 +00:00
A
c846b2e453
Merge pull request #112 from diogobaeder/master
Properly formatting UUID if value to be unmarshalled is already a UUID.
2019-03-22 14:30:02 +00:00
Artur Maciag
aa206d868e Test string format quirks rename fix 2019-03-22 14:14:42 +00:00
Artur Maciag
d0e163b5ba Test string format UUID non strict fix 2019-03-22 14:05:54 +00:00
Artur Maciag
9aa16dff0f Test object with invalid additional properties fix 2019-03-22 13:44:05 +00:00
A
beaa08a9c0
Merge branch 'master' into master 2019-03-22 13:29:04 +00:00
A
aa978cbe00
Merge pull request #121 from ondratu/master
Object additionalProperties support
2019-03-22 13:21:43 +00:00
Artur Maciąg
cd0ca5d26f Raw value type strict validation 2019-03-22 11:21:50 +00:00
Ondrej Tuma
83b9c37915 Object additionalProperties support
* Default is true like in specification
* When is set false, it works like in past
* Object with types works
2019-03-12 16:01:28 +01:00
Marco Capitani
f748783842 add support for "links" in Response 2019-03-08 14:12:11 +01:00
Marco Capitani
f232f7419b add support for path-level parameters 2019-03-08 10:19:09 +01:00
Diogo Baeder de Paula Pinto
a08b62035e Properly formatting UUID if value to be unmarshalled is already a UUID.
Before this change, if a UUID instance got received as value in the
Schema, it was breaking the unmarshal because UUID instances can't be
used as values to instantiate other UUIDs.
2019-02-28 18:25:22 -03:00
Artur Maciag
a533a080cc byte string format 2019-02-27 00:59:45 +00:00
Artur Maciag
48d1d1c8ae UUID string format tests 2019-02-26 14:22:28 +00:00
A
922fce4085
Merge pull request #75 from smarlowucf/flake8
Switch test requirement to pytest-flake8.
2019-02-24 03:29:44 +00:00
Artur Maciąg
dccb93bbfe test validaotr escape sequence fix 2019-02-24 02:28:45 +00:00
A
114ab79162
Merge branch 'master' into date-time-rfc3339 2018-09-13 20:42:32 +01:00
Domen Kožar
399602f013
sync master changes with exception refactoring 2018-09-13 11:59:44 +01:00
Domen Kožar
286e26c4ed
openapi 3.0 defines date-time format to be rfc3339 2018-09-12 15:16:46 +01:00
8db5c08ed1 Add support for additional validation properties
Add support for the following validation properties:
- multipleOf
- maximum
- exclusiveMaximum
- minimum
- exclusiveMinimum
- maxLength
- minLength
- pattern
- maxItems
- minItems
- uniqueItems
- maxProperties
- minProperties

Fixes #49
2018-09-09 00:30:38 -04:00
Marcin Molenda
e5cb549ea1 Expose tags in Operation object 2018-08-31 16:57:53 +02:00
p1c2u
0cbbdb0232 Unmarshal any schema type 2018-08-23 09:29:36 +01:00
p1c2u
05b8a30091 Any schema type 2018-08-22 14:27:32 +01:00
Artur Maciag
82f32be1e7 String validation 2018-08-22 13:49:24 +01:00
Artur Maciag
e395b50558 Collection validation 2018-08-22 10:29:39 +01:00
p1c2u
0915e94530 Object validation 2018-08-22 09:34:18 +01:00
Artur Maciag
f9a7472c92 Separate schema casting and validation 2018-08-17 18:35:21 +01:00
Artur Maciag
b75798aa62 Handle parameter deserialization errors 2018-08-17 13:25:31 +01:00
grktsh
d4f65a2ed2 Support unmarshaling string with format keyword 2018-08-17 13:25:12 +09:00
A
ac797bcf2a
Merge pull request #46 from HoverHell/paramlocations
Request headers and cookies parameter parsing fix
2018-08-13 20:21:46 +01:00
p1c2u
a9d858e940 Python2 compatibility module 2018-07-29 00:16:30 +01:00
p1c2u
3ab55e44bd Lazy schema references 2018-07-28 22:12:47 +01:00
Rafael Caricio
15fc9b009a Makes it possible to access API examples 2018-07-24 09:47:02 +02:00
Rafael Caricio
8ab0b6206e Populate operation_id attr 2018-07-23 18:02:51 +02:00
Artur Maciag
f8e977cc17 Parameters tests 2018-07-09 12:10:05 +01:00
Artur Maciag
54b8011603 Mimetype wildcards support 2018-05-30 15:01:01 +01:00
Artur Maciag
78f55ee80f Schema additional properties support 2018-05-30 11:20:35 +01:00
Artur Maciag
d87b60ade7 Schema format accepts any value 2018-05-30 09:41:34 +01:00
Artur Maciag
4c75f0f9b7 OneOf schema support 2018-05-25 16:50:09 +01:00
Artur Maciag
4e1a61aace Exceptions restructure 2018-05-25 11:30:50 +01:00
Artur Maciag
9b05d7b271 Wrapper restructure 2018-05-25 11:30:50 +01:00
Artur Maciag
bd1b0117a4 Schema objects tests moved 2018-05-25 11:30:50 +01:00
Artur Maciag
7111a91cef Validators restructure 2018-05-25 11:30:50 +01:00
Artur Maciag
734a4673f8 Schema objects restructure 2018-05-25 11:30:50 +01:00