Documentation
Documentation
goninja turns an annotated Go struct into a complete REST resource: typed
request and response schemas, net/http handlers, GORM-backed queries,
validation, filtering, ordering, pagination and an OpenAPI fragment.
It does this by writing Go source. goninja generate reads your models and
emits one <model>_generated.go file per model — ordinary code you can read,
diff, and step through in a debugger. Nothing is resolved by reflection at
request time, so a mistake in a struct tag surfaces as a failed build rather
than a surprise in production.
goninja is pre-alpha. The API described here is implemented and tested, but it
may change without notice and there is no compatibility guarantee yet.
Start here
Install the CLI and go from an empty module to a running API.
The pipeline from struct tag to generated handler, and what runs at request time.
Guides
Task-oriented walkthroughs for each part of the framework.
Reference
Every verb and modifier the goninja tag accepts.
What lands in each generated file.
Flags, defaults and watch mode.
The types and functions generated code depends on.