diff --git a/openapi_core/deserializing/parameters/deserializers.py b/openapi_core/deserializing/parameters/deserializers.py index 7eaf6c5..5dd9135 100644 --- a/openapi_core/deserializing/parameters/deserializers.py +++ b/openapi_core/deserializing/parameters/deserializers.py @@ -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( diff --git a/openapi_core/schema/parameters.py b/openapi_core/schema/parameters.py index f1ead22..78d39db 100644 --- a/openapi_core/schema/parameters.py +++ b/openapi_core/schema/parameters.py @@ -19,6 +19,6 @@ def get_explode(param): if 'explode' in param: return param['explode'] - #determine default + # determine default style = get_style(param) return style == 'form' diff --git a/openapi_core/templating/media_types/finders.py b/openapi_core/templating/media_types/finders.py index 0bd3006..a677781 100644 --- a/openapi_core/templating/media_types/finders.py +++ b/openapi_core/templating/media_types/finders.py @@ -2,8 +2,6 @@ from __future__ import division import fnmatch -from six import iteritems - from openapi_core.templating.media_types.exceptions import MediaTypeNotFound diff --git a/openapi_core/templating/paths/finders.py b/openapi_core/templating/paths/finders.py index cd7eb64..4daf6a3 100644 --- a/openapi_core/templating/paths/finders.py +++ b/openapi_core/templating/paths/finders.py @@ -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 diff --git a/openapi_core/unmarshalling/schemas/unmarshallers.py b/openapi_core/unmarshalling/schemas/unmarshallers.py index e9bd6ec..9fd0789 100644 --- a/openapi_core/unmarshalling/schemas/unmarshallers.py +++ b/openapi_core/unmarshalling/schemas/unmarshallers.py @@ -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: diff --git a/openapi_core/validation/request/validators.py b/openapi_core/validation/request/validators.py index 1414b91..fb01adf 100644 --- a/openapi_core/validation/request/validators.py +++ b/openapi_core/validation/request/validators.py @@ -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' diff --git a/openapi_core/validation/validators.py b/openapi_core/validation/validators.py index 51bf56c..62a70a7 100644 --- a/openapi_core/validation/validators.py +++ b/openapi_core/validation/validators.py @@ -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,