codegen_routes.generate_routes now sanitizes resource identifiers (fetch-requests -> fetch_requests), optionally prepends 'request: Request' (inject_request) and emits <resource>/routes.py packages with __init__.py (package). multipart/form-data and x-www-form-urlencoded bodies expand to per-property UploadFile/File/Form params instead of an opaque dict; spec paths are normalized to forward slashes to avoid Windows escape issues. Adds CLI flags --inject-request/--package, 7 focused tests, and refreshes lib/wiki/MCP docs to the real CLI.
12 lines
233 B
Python
12 lines
233 B
Python
from pathlib import Path
|
|
|
|
def generate_routes(
|
|
spec_path: Path,
|
|
output_dir: Path,
|
|
*,
|
|
use_models: bool = ...,
|
|
models_module: str = ...,
|
|
inject_request: bool = ...,
|
|
package: bool = ...,
|
|
) -> list[Path]: ...
|