Summary
Make the per-entity http flag (#93) behave correctly in the Go (Gin) and Python (FastAPI) generators. The flag is generic — it only does real work where a generated route can't be cleanly overridden. So the two languages need different follow-ups:
| Generator |
Can override a generated route without suppressing? |
What http: false must do |
| NestJS (done, #93) |
No |
Suppress the controller |
| Go / Gin |
No — RegisterAllRoutes loops handlers and Gin panics on a duplicate method+path |
Implement suppression (real action) |
| Python / FastAPI |
Yes — main.py includes autogen_router; FastAPI matches in registration order, so an app router registered first shadows the generated route |
No-op + document the override pattern |
Current state (after #93 / PR #94)
Entity.http (+ top-level default) is parsed generically. In generate.ts the controller skip is scoped to language === "typescript", so for Go and Python the flag is currently a no-op (controllers always generated — safe, no broken output).
Work
Go (Gin) — implement suppression
When http: false for an entity: don't generate its handler/routes and don't register them in RegisterAllRoutes (src/lib/templates/go/index-module.eta + the handler template), while still emitting the model and service. Then extend the generate.ts guard to include go. Tests mirroring the TS ones.
Python (FastAPI) — no-op + document override
http: false should remain a no-op for FastAPI (don't suppress). Instead document the idiomatic override: register your APIRouter for the path before autogen_router is included in main.py (first match wins). Optionally emit an informational notice if http: false is set on a FastAPI entity, pointing at the override pattern. Covered in the custom-endpoints skill (see below).
Docs
Add a per-framework "replacing a generated endpoint" section to the custom-endpoints skill (apsoai/skills): NestJS → http: false + write the controller; Gin → http: false; FastAPI → register your router ahead of autogen_router (no flag).
Related
Summary
Make the per-entity
httpflag (#93) behave correctly in the Go (Gin) and Python (FastAPI) generators. The flag is generic — it only does real work where a generated route can't be cleanly overridden. So the two languages need different follow-ups:http: falsemust doRegisterAllRoutesloops handlers and Gin panics on a duplicate method+pathmain.pyincludesautogen_router; FastAPI matches in registration order, so an app router registered first shadows the generated routeCurrent state (after #93 / PR #94)
Entity.http(+ top-level default) is parsed generically. Ingenerate.tsthe controller skip is scoped tolanguage === "typescript", so for Go and Python the flag is currently a no-op (controllers always generated — safe, no broken output).Work
Go (Gin) — implement suppression
When
http: falsefor an entity: don't generate its handler/routes and don't register them inRegisterAllRoutes(src/lib/templates/go/index-module.eta+ the handler template), while still emitting the model and service. Then extend thegenerate.tsguard to includego. Tests mirroring the TS ones.Python (FastAPI) — no-op + document override
http: falseshould remain a no-op for FastAPI (don't suppress). Instead document the idiomatic override: register yourAPIRouterfor the path beforeautogen_routeris included inmain.py(first match wins). Optionally emit an informational notice ifhttp: falseis set on a FastAPI entity, pointing at the override pattern. Covered in thecustom-endpointsskill (see below).Docs
Add a per-framework "replacing a generated endpoint" section to the
custom-endpointsskill (apsoai/skills): NestJS →http: false+ write the controller; Gin →http: false; FastAPI → register your router ahead ofautogen_router(no flag).Related
Entity.http.