mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-22 03:00:10 +00:00
Linting fixes
This commit is contained in:
parent
bc4f0c7e40
commit
c407e960ca
7 changed files with 8 additions and 11 deletions
|
@ -16,7 +16,6 @@ class PrimitiveDeserializer(object):
|
|||
self.style = get_style(self.param)
|
||||
|
||||
def __call__(self, value):
|
||||
style = get_style(self.param)
|
||||
if (self.param['in'] == 'query' and value == "" and
|
||||
not self.param.getkey('allowEmptyValue', False)):
|
||||
raise EmptyParameterValue(
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
from __future__ import division
|
||||
import fnmatch
|
||||
|
||||
from six import iteritems
|
||||
|
||||
from openapi_core.templating.media_types.exceptions import MediaTypeNotFound
|
||||
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
from __future__ import division
|
||||
|
||||
from more_itertools import peekable
|
||||
from six import iteritems
|
||||
from six.moves.urllib.parse import urljoin, urlparse
|
||||
|
||||
from openapi_core.schema.servers import is_absolute
|
||||
|
|
|
@ -213,7 +213,8 @@ class ObjectUnmarshaller(ComplexUnmarshaller):
|
|||
extra_props = set(value_props_names) - set(all_props_names)
|
||||
|
||||
properties = {}
|
||||
additional_properties = self.schema.getkey('additionalProperties', True)
|
||||
additional_properties = self.schema.getkey(
|
||||
'additionalProperties', True)
|
||||
if isinstance(additional_properties, dict):
|
||||
additional_prop_schema = self.schema / 'additionalProperties'
|
||||
for prop_name in extra_props:
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
"""OpenAPI core validation request validators module"""
|
||||
from __future__ import division
|
||||
from itertools import chain
|
||||
from six import iteritems
|
||||
|
||||
from openapi_core.casting.schemas.exceptions import CastError
|
||||
from openapi_core.deserializing.exceptions import DeserializeError
|
||||
|
@ -172,7 +171,7 @@ class RequestValidator(BaseValidator):
|
|||
return RequestParameters(**locations), errors
|
||||
|
||||
def _get_body(self, request, operation):
|
||||
if not 'requestBody' in operation:
|
||||
if 'requestBody' not in operation:
|
||||
return None, []
|
||||
|
||||
request_body = operation / 'requestBody'
|
||||
|
|
|
@ -39,7 +39,7 @@ class BaseValidator(object):
|
|||
|
||||
def _cast(self, param_or_media_type, value):
|
||||
# return param_or_media_type.cast(value)
|
||||
if not 'schema' in param_or_media_type:
|
||||
if 'schema' not in param_or_media_type:
|
||||
return value
|
||||
|
||||
from openapi_core.casting.schemas.factories import SchemaCastersFactory
|
||||
|
@ -49,13 +49,14 @@ class BaseValidator(object):
|
|||
return caster(value)
|
||||
|
||||
def _unmarshal(self, param_or_media_type, value, context):
|
||||
if not 'schema' in param_or_media_type:
|
||||
if 'schema' not in param_or_media_type:
|
||||
return value
|
||||
|
||||
from openapi_core.unmarshalling.schemas.factories import (
|
||||
SchemaUnmarshallersFactory,
|
||||
)
|
||||
spec_resolver = self.spec.accessor.dereferencer.resolver_manager.resolver
|
||||
spec_resolver = self.spec.accessor.dereferencer.resolver_manager.\
|
||||
resolver
|
||||
unmarshallers_factory = SchemaUnmarshallersFactory(
|
||||
spec_resolver, self.format_checker,
|
||||
self.custom_formatters, context=context,
|
||||
|
|
Loading…
Reference in a new issue