Skip to content

Commit

Permalink
Update types for backward compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
hasansezertasan committed Feb 3, 2024
1 parent 504c760 commit ab80142
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/openapidoc/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass, field

from typing_extensions import Annotated, Doc
from typing_extensions import Annotated, Doc, List


@dataclass
Expand Down Expand Up @@ -34,23 +34,23 @@ 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 `<head>` tag.
"""
),
] = 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 `<body>` tag.
"""
),
] = 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 `<head>` tag.
Expand Down
4 changes: 2 additions & 2 deletions src/openapidoc/redoc.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/openapidoc/swaggerui.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -62,15 +62,15 @@ 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.
"""
),
] = None
swagger_ui_parameters: Annotated[
Optional[dict[str, Any]],
Optional[Dict[str, Any]],
Doc(
"""
Configuration parameters for Swagger UI.
Expand All @@ -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.
Expand Down

0 comments on commit ab80142

Please sign in to comment.