mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-22 03:00:10 +00:00
AnyUnmarshaller use allOf schemas test
This commit is contained in:
parent
95af36994e
commit
c40bd4d0e4
2 changed files with 18 additions and 0 deletions
|
@ -329,6 +329,7 @@ components:
|
|||
message:
|
||||
type: string
|
||||
ExtendedError:
|
||||
type: object
|
||||
x-model: ExtendedError
|
||||
allOf:
|
||||
- $ref: "#/components/schemas/Error"
|
||||
|
|
|
@ -466,6 +466,23 @@ class TestSchemaUnmarshallerCall(object):
|
|||
])
|
||||
assert unmarshaller_factory(schema)(['hello']) == ['hello']
|
||||
|
||||
def test_schema_any_all_of(self, unmarshaller_factory):
|
||||
schema = Schema(all_of=[
|
||||
Schema('array', items=Schema('string')),
|
||||
])
|
||||
assert unmarshaller_factory(schema)(['hello']) == ['hello']
|
||||
|
||||
def test_schema_any_all_of_any(self, unmarshaller_factory):
|
||||
schema = Schema(all_of=[
|
||||
Schema(),
|
||||
Schema('string', schema_format='date'),
|
||||
])
|
||||
value = '2018-01-02'
|
||||
|
||||
result = unmarshaller_factory(schema)(value)
|
||||
|
||||
assert result == datetime.date(2018, 1, 2)
|
||||
|
||||
def test_schema_any(self, unmarshaller_factory):
|
||||
schema = Schema()
|
||||
assert unmarshaller_factory(schema)('string') == 'string'
|
||||
|
|
Loading…
Reference in a new issue