You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d2144e1
Browse filesBrowse the repository at this point in the historyBrowse files
fix(codegen): generated routes say they are unauthenticated in every port (#367)
The TypeScript route generators already said so, showed how to guard the mount, and
offered `expose` for per-verb control. The C#, Java, Kotlin and Python route
generators said nothing, so an adopter mounting them got open CRUD over every table
with no warning. That is how the first real app ended up throwing route codegen away.
Each now emits a doc comment on the generated register method / controller / router:
- the endpoints are unauthenticated;
- how to guard them in that framework (C#: map on a group with
RequireAuthorization(); Spring: require authentication for the controller's path;
FastAPI: include_router with a dependency);
- a row-ownership rule cannot be expressed on a mount, so eject the generator
(`dotnet meta eject`, `mvn metaobjects:eject`, `metaobjects eject`) and hand-write
those endpoints. Non-TS REST templates are frozen for features, so they get no
`expose` option; eject is the per-verb path there.
The Kotlin example names the path in prose rather than a `/**` glob: Kotlin nests block
comments, so `/*` inside a KDoc would leave the comment unclosed and the controller
would not compile. The snapshot test compares text and the compile gate excludes
controllers, so nothing would have caught it.
Tests: C# codegen 569 pass / conformance 1117 pass; codegen-spring 297, codegen-kotlin
387 (snapshots updated, both compile gates green); Python 2145 pass, compile gate green.
Showcase regenerated with each port's own CLI; `verify --codegen` in sync for C# and
Python, site payload fresh.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M1mRRB1K2WdYy82kntMQdx
Copy file name to clipboardExpand all lines: server/java/codegen-kotlin/src/main/kotlin/com/metaobjects/generator/kotlin/KotlinSpringControllerGenerator.kt
+28-3Lines changed: 28 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -344,7 +344,16 @@ open class KotlinSpringControllerGenerator : MultiFileDirectGeneratorBase<MetaOb
Copy file name to clipboardExpand all lines: server/java/codegen-kotlin/src/test/resources/snapshots/entity-with-controller/acme/blog/AuthorController.kt
Copy file name to clipboardExpand all lines: server/java/codegen-kotlin/src/test/resources/snapshots/entity-with-view/acme/report/SalesReportController.kt
0 commit comments