Skip to content

Commit

Permalink
OpenAPI - types
Browse files Browse the repository at this point in the history
  • Loading branch information
commonism committed Sep 26, 2023
1 parent 4e2fc1b commit fe2ee66
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions aiopenapi3/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from .errors import ReferenceResolutionError
from .loader import Loader, NullLoader
from .plugin import Plugin, Plugins
from .base import RootBase, ReferenceBase, SchemaBase, OperationBase
from .base import RootBase, ReferenceBase, SchemaBase, OperationBase, DiscriminatorBase
from .request import RequestBase
from .v30.paths import Operation

Expand Down Expand Up @@ -401,8 +401,6 @@ def _init_operationindex(self, use_operation_tags: bool) -> bool:
@staticmethod
def _get_combined_attributes(schema):
"""Combine attributes from the schema."""
from .base import DiscriminatorBase

return (
getattr(schema, "oneOf", []) # Swagger compat
+ (
Expand All @@ -418,7 +416,7 @@ def _get_combined_attributes(schema):
)

@classmethod
def _process_schema_attributes(cls, schema, processed):
def _process_schema_attributes(cls, schema: "SchemaType", processed: Set[int]) -> Dict[int, "SchemaType"]:
"""Process attributes of a schema and filter out the processed ones."""
combined_attributes = cls._get_combined_attributes(schema)
return {
Expand All @@ -432,7 +430,7 @@ def _process_schema_attributes(cls, schema, processed):
}

@classmethod
def _iterate_schemas(cls, schemas: dict, next_set: set, processed: set):
def _iterate_schemas(cls, schemas: Dict[int, "SchemaType"], next_set: Set[int], processed: Set[int]) -> Set[int]:
"""Iteratively collect all schemas related to the starting set."""
while next_set:
processed.update(next_set)
Expand Down

0 comments on commit fe2ee66

Please sign in to comment.