mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-22 19:18:36 +00:00
Merge pull request #42 from p1c2u/fix/schema-format-accept-any-value
Schema format accepts any value
This commit is contained in:
commit
19bfff89dc
3 changed files with 6 additions and 5 deletions
|
@ -6,7 +6,7 @@ import warnings
|
|||
from six import iteritems
|
||||
|
||||
from openapi_core.extensions.models.factories import ModelFactory
|
||||
from openapi_core.schema.schemas.enums import SchemaType, SchemaFormat
|
||||
from openapi_core.schema.schemas.enums import SchemaType
|
||||
from openapi_core.schema.schemas.exceptions import (
|
||||
InvalidSchemaValue, UndefinedSchemaProperty, MissingSchemaProperty,
|
||||
OpenAPISchemaError, NoOneOfSchema, MultipleOneOfSchema,
|
||||
|
@ -33,7 +33,7 @@ class Schema(object):
|
|||
self.model = model
|
||||
self.properties = properties and dict(properties) or {}
|
||||
self.items = items
|
||||
self.format = SchemaFormat(schema_format)
|
||||
self.format = schema_format
|
||||
self.required = required or []
|
||||
self.default = default
|
||||
self.nullable = nullable
|
||||
|
|
|
@ -259,6 +259,7 @@ components:
|
|||
properties:
|
||||
name:
|
||||
type: string
|
||||
format: custom
|
||||
TagList:
|
||||
type: array
|
||||
items:
|
||||
|
|
|
@ -136,7 +136,7 @@ class TestPetstore(object):
|
|||
assert type(parameter.schema) == Schema
|
||||
assert parameter.schema.type.value ==\
|
||||
schema_spec['type']
|
||||
assert parameter.schema.format.value ==\
|
||||
assert parameter.schema.format ==\
|
||||
schema_spec.get('format')
|
||||
assert parameter.schema.required == schema_spec.get(
|
||||
'required', [])
|
||||
|
@ -171,7 +171,7 @@ class TestPetstore(object):
|
|||
assert type(media_type.schema) == Schema
|
||||
assert media_type.schema.type.value ==\
|
||||
schema_spec['type']
|
||||
assert media_type.schema.format.value ==\
|
||||
assert media_type.schema.format ==\
|
||||
schema_spec.get('format')
|
||||
assert media_type.schema.required == schema_spec.get(
|
||||
'required', False)
|
||||
|
@ -690,7 +690,7 @@ class TestPetstore(object):
|
|||
assert parameters == {}
|
||||
assert body is None
|
||||
|
||||
data_json = []
|
||||
data_json = ['cats', 'birds']
|
||||
data = json.dumps(data_json)
|
||||
response = MockResponse(data)
|
||||
|
||||
|
|
Loading…
Reference in a new issue