Been building goninja, a Go framework that generates CRUD REST APIs from annotated structs — routing, validation, OpenAPI, the rest.
It's the Go counterpart to a Python project I already maintain, django-ninja-aio-crud — same idea, define the model once and get the API. Difference here: no runtime reflection, it generates real Go code that lives in your repo, readable like anything you'd write by hand.
hand.
type Book struct {
ID string `gorm:"primaryKey" goninja:"list,retrieve"`
Title string `goninja:"list,retrieve,create,update" validate:"required"`
AuthorID string `goninja:"list,retrieve,create,update,filter"`
Price float64 `goninja:"list,retrieve,create,update,filter" validate:"min=0"`
}
$ goninja generate -models-import myapp/models
Top comments (0)