From b8a8ae9091ade21268ed8a558e376a0a5c63318f Mon Sep 17 00:00:00 2001 From: Joshua Thompson-Lindley Date: Wed, 20 Sep 2023 12:17:53 +0100 Subject: [PATCH] fix; --- src/flask_openapi/__init__.py | 2 +- src/flask_openapi/core.py | 2 +- src/flask_openapi/openapi/specs.py | 2 +- src/flask_openapi/utils/types.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/flask_openapi/__init__.py b/src/flask_openapi/__init__.py index 42a8c80..5a090c5 100644 --- a/src/flask_openapi/__init__.py +++ b/src/flask_openapi/__init__.py @@ -1,5 +1,5 @@ # DO NOT CHANGE MANUALLY THIS IS CHANGED IN THE PIPELINES -__version__ = "1.4.0" +__version__ = "2.0.0" import flask_openapi.compat.marshmallow as marshmallow_shim # noqa from flask_openapi.core import OpenAPI # noqa diff --git a/src/flask_openapi/core.py b/src/flask_openapi/core.py index 5799771..29c8924 100644 --- a/src/flask_openapi/core.py +++ b/src/flask_openapi/core.py @@ -327,7 +327,7 @@ def update_schemas_parsers(self, doc, schemas, parsers, definitions) -> None: ) # TODO support anyOf and oneOf in the future - if (json_schema is not None) and type(json_schema) == dict: + if (json_schema is not None) and isinstance(json_schema, dict): schemas[location] = json_schema self.set_schemas(schemas, location, definitions) diff --git a/src/flask_openapi/openapi/specs.py b/src/flask_openapi/openapi/specs.py index 1481e3c..256a098 100644 --- a/src/flask_openapi/openapi/specs.py +++ b/src/flask_openapi/openapi/specs.py @@ -110,7 +110,7 @@ def get_operations( else: update_schemas = swag.get("definitions", {}) - if type(update_schemas) == list and type(update_schemas[0]) == dict: + if isinstance(update_schemas, list) and isinstance(update_schemas[0], dict): (update_schemas,) = update_schemas definitions.update(update_schemas) diff --git a/src/flask_openapi/utils/types.py b/src/flask_openapi/utils/types.py index 6bd73a7..de8d6b1 100644 --- a/src/flask_openapi/utils/types.py +++ b/src/flask_openapi/utils/types.py @@ -81,4 +81,4 @@ def __ge__(self, other): @property def text_type(self) -> Type[str]: - return text_type \ No newline at end of file + return text_type