Skip to content

Commit

Permalink
chore: openapiの型を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Feb 2, 2024
1 parent 4348598 commit 3736ae4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions compiler/type.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Literal, TypedDict
from typing import Any, Literal, NotRequired, TypedDict


class OpenAPIInfo(TypedDict):
Expand All @@ -24,9 +24,17 @@ class OpenAPIPath(TypedDict):
security: list[dict[str, list[Any]]]
requestBody: OpenAPIRequestBody

class OpenAPIComponentProperty(TypedDict):
type: str | None
format: NotRequired[str]
items: NotRequired["OpenAPIComponentSchema"]

class OpenAPIComponentSchema(TypedDict):
type: Literal["object"]
properties: dict[str, OpenAPIComponentProperty]

class OpenAPIComponents(TypedDict):
schemas: dict[str, dict[str, Any]]
schemas: dict[str, OpenAPIComponentSchema]

class OpenAPI(TypedDict):
openapi: str
Expand Down

0 comments on commit 3736ae4

Please sign in to comment.