Skip to content

v0.1.1

Choose a tag to compare

@zombocoder zombocoder released this 12 Jul 11:09
· 37 commits to main since this release

Adds the request-validation plugin and fixes the fresh-project generate experience.

New: plugins/validate

An AnnotationProvider + Analyzer + Generator that turns field-constraint annotations into a runtime.Validator, wired onto goboot's HTTP bind→validate step:

  • @Required, @Min(n), @Max(n), @Size(min=,max=), @Pattern("re"), @Email
  • Generates a type-switch validator that accumulates every failure into a 400 Problem.
  • Analyzer reports type mismatches, uncompilable regexes, malformed @Size, and constraints on non-request types.

Install: add github.com/zombocoder/goboot/plugins/validate to goboot.yaml and wire httpDeps.Validator = generated.NewValidator().

Tag: plugins/validate/v0.1.1 (requires core v0.1.1).

Core

  • Fresh-project generate fix — a composition root importing the not-yet-generated wiring no longer makes goboot generate fail on an empty/absent output directory (previously broke on every run with clean: true). The loader ignores load errors that stem solely from the absent output package, matched tightly so genuine errors still surface.
  • model.Application.Package — exposes the generated output package name for Go-emitting plugins.
  • Field-target AnnotatedDecls now carry their owning struct (Receiver), enabling field-driven generation via the deeper plugin API.

Closes #34.


⚠️ Superseded by v0.1.2, which corrects goboot version reporting 0.1.0. Prefer v0.1.2.