diff --git a/aiopenapi3/openapi.py b/aiopenapi3/openapi.py index 734294a5..7e5a998f 100644 --- a/aiopenapi3/openapi.py +++ b/aiopenapi3/openapi.py @@ -396,6 +396,7 @@ def _init_operationindex(self, use_operation_tags: bool): self._operationindex = OperationIndex(self, use_operation_tags) @staticmethod + def _get_combined_attributes(schema): """Combine attributes from the schema.""" return ( diff --git a/aiopenapi3/v20/general.py b/aiopenapi3/v20/general.py index 8f93bda7..ad07831a 100644 --- a/aiopenapi3/v20/general.py +++ b/aiopenapi3/v20/general.py @@ -1,5 +1,5 @@ import typing -from typing import Optional, Any +from typing import Optional, Any, Union from pydantic import Field, ConfigDict, PrivateAttr @@ -7,7 +7,8 @@ from ..base import ObjectExtended, ObjectBase, ReferenceBase if typing.TYPE_CHECKING: - from .._types import SchemaType + from .schemas import Schema + from .parameter import Parameter class ExternalDocumentation(ObjectExtended): @@ -31,7 +32,7 @@ class Reference(ObjectBase, ReferenceBase): ref: str = Field(alias="$ref") - _target: "SchemaType" = PrivateAttr() + _target: Union["Schema", "Parameter", "Reference"] = PrivateAttr(default=None) model_config = ConfigDict(extra="ignore") diff --git a/aiopenapi3/v30/general.py b/aiopenapi3/v30/general.py index 808e26f4..d4dc171f 100644 --- a/aiopenapi3/v30/general.py +++ b/aiopenapi3/v30/general.py @@ -33,7 +33,7 @@ class Reference(ObjectBase, ReferenceBase): ref: str = Field(alias="$ref") - _target: Union["Schema", "Parameter", "Reference"] = PrivateAttr() + _target: Union["Schema", "Parameter", "Reference"] = PrivateAttr(default=None) model_config = ConfigDict( extra="ignore", # """This object cannot be extended with additional properties and any properties added SHALL be ignored.""" diff --git a/aiopenapi3/v31/general.py b/aiopenapi3/v31/general.py index b612888b..7a681e06 100644 --- a/aiopenapi3/v31/general.py +++ b/aiopenapi3/v31/general.py @@ -34,7 +34,7 @@ class Reference(ObjectBase, ReferenceBase): summary: Optional[str] = Field(default=None) description: Optional[str] = Field(default=None) - _target: Union["Schema", "Parameter", "Reference", "PathItem"] = PrivateAttr() + _target: Union["Schema", "Parameter", "Reference", "PathItem"] = PrivateAttr(default=None) model_config = ConfigDict( # """This object cannot be extended with additional properties and any properties added SHALL be ignored.""" diff --git a/aiopenapi3/version.py b/aiopenapi3/version.py index 493f7415..4fbec93e 100644 --- a/aiopenapi3/version.py +++ b/aiopenapi3/version.py @@ -1 +1 @@ -__version__ = "0.3.0" +__version__ = "0.4.0a3" diff --git a/pyproject.toml b/pyproject.toml index da229b4e..4ba6ca03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ dependencies = [ ] requires-python = ">=3.8" readme = "README.md" -license = {text = "MIT"} +license = {text = "BSD-3-Clause"} classifiers = [ "Development Status :: 3 - Alpha", "Environment :: Web Environment",