Add swagger-drogon generator
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Route:
|
||||
controller: str
|
||||
handler: str
|
||||
raw_path: str
|
||||
http_method: str
|
||||
metadata: dict[str, str]
|
||||
header: Path
|
||||
|
||||
@property
|
||||
def operation_id(self) -> str:
|
||||
return f"{self.controller}.{self.handler}"
|
||||
|
||||
|
||||
@dataclass
|
||||
class InferredOperation:
|
||||
path_parameters: list[dict[str, Any]] = field(default_factory=list)
|
||||
query_parameters: list[dict[str, Any]] = field(default_factory=list)
|
||||
request_schema: dict[str, Any] | None = None
|
||||
response_schema: dict[str, Any] | None = None
|
||||
Reference in New Issue
Block a user