feat: codegen routes — sanitize resource names, --inject-request/--package, expand form bodies
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.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
"name": "get_health",
|
||||
"kind": "function",
|
||||
"path": "openapi_first.templates.health_app.routes.get_health",
|
||||
"signature": "<bound method Function.signature of Function('get_health', 16, 32)>",
|
||||
"signature": "get_health() -> dict",
|
||||
"docstring": "Health check operation handler.\n\nThis function implements the OpenAPI operation identified by\n``operationId: get_health``.\n\nIt contains no routing metadata or framework-specific logic.\nRequest binding, HTTP method, and response semantics are defined\nexclusively by the OpenAPI specification.\n\nReturns\n-------\ndict\n A minimal liveness payload indicating service health."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user