From ab80142c79da3908bdf2ae25d1d73f256683b6e6 Mon Sep 17 00:00:00 2001 From: hasansezertasan Date: Sat, 3 Feb 2024 17:47:57 +0300 Subject: [PATCH] Update types for backward compatibility. --- src/openapidoc/base.py | 8 ++++---- src/openapidoc/redoc.py | 4 ++-- src/openapidoc/swaggerui.py | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/openapidoc/base.py b/src/openapidoc/base.py index 45274c2..97dfd6a 100644 --- a/src/openapidoc/base.py +++ b/src/openapidoc/base.py @@ -1,6 +1,6 @@ from dataclasses import dataclass, field -from typing_extensions import Annotated, Doc +from typing_extensions import Annotated, Doc, List @dataclass @@ -34,7 +34,7 @@ class Base: ), ] = "/openapi.json" head_js_urls: Annotated[ - list[str], + List[str], Doc( """ A list of URLs to JavaScript files that should be loaded in the `` tag. @@ -42,7 +42,7 @@ class Base: ), ] = field(default_factory=list) tail_js_urls: Annotated[ - list[str], + List[str], Doc( """ A list of URLs to JavaScript files that should be loaded at the end of the `` tag. @@ -50,7 +50,7 @@ class Base: ), ] = field(default_factory=list) head_css_urls: Annotated[ - list[str], + List[str], Doc( """ A list of URLs to CSS files that should be loaded in the `` tag. diff --git a/src/openapidoc/redoc.py b/src/openapidoc/redoc.py index 6261f37..df2eff2 100644 --- a/src/openapidoc/redoc.py +++ b/src/openapidoc/redoc.py @@ -1,7 +1,7 @@ import json from dataclasses import dataclass -from typing_extensions import Annotated, Any, Doc, Optional +from typing_extensions import Annotated, Any, Dict, Doc, Optional from .base import Base @@ -45,7 +45,7 @@ class ReDoc(Base): ), ] = True ui_parameters: Annotated[ - Optional[dict[str, Any]], + Optional[Dict[str, Any]], Doc( """ Configuration parameters for Redoc UI. diff --git a/src/openapidoc/swaggerui.py b/src/openapidoc/swaggerui.py index 4cc7dc3..459dc01 100644 --- a/src/openapidoc/swaggerui.py +++ b/src/openapidoc/swaggerui.py @@ -1,7 +1,7 @@ import json from dataclasses import dataclass -from typing_extensions import Annotated, Any, Doc, Optional +from typing_extensions import Annotated, Any, Dict, Doc, List, Optional from .base import Base @@ -62,7 +62,7 @@ class SwaggerUI(Base): ), ] = "/docs/oauth2-redirect" init_oauth: Annotated[ - Optional[dict[str, Any]], + Optional[Dict[str, Any]], Doc( """ A dictionary with Swagger UI OAuth2 initialization configurations. @@ -70,7 +70,7 @@ class SwaggerUI(Base): ), ] = None swagger_ui_parameters: Annotated[ - Optional[dict[str, Any]], + Optional[Dict[str, Any]], Doc( """ Configuration parameters for Swagger UI. @@ -79,7 +79,7 @@ class SwaggerUI(Base): ), ] = None swagger_ui_presets: Annotated[ - Optional[list[str]], + Optional[List[str]], Doc( """ Configuration parameters for Swagger UI presets.