Analyzer::Go::Huma
Inherits Analyzer::Go::GoEngine < Analyzer < FileHelper < Reference < Object
Huma (https://huma.rocks/) is an OpenAPI-first Go framework
where every operation is registered through
huma.Register(api, huma.Operation{Method: ..., Path: ...}, handler)
The Operation literal carries method/path verbatim, and the
handler's Input struct fields declare parameter shape via
tags (path:"id", query:"limit", header:"X-Auth", plus
a Body field for request bodies). That makes extraction
unusually precise compared to other Go routers.
Constants
One precompiled matcher instead of a String#includes? scan per
.go file: includes? runs Rabin-Karp over the whole buffer and
the marker is absent in the overwhelming majority of files in a
polyglot repo, so every one of them pays the full scan. See
Analyzer#content_matches?.
Tags we lift from Input struct fields onto endpoint params.
Crystal recompiles an interpolated regex literal on every evaluation (a full PCRE2 JIT compile) — precompile the fixed tag matchers once at load time instead of per struct field.
Huma v2's typed convenience helpers — huma.Get(api, "/path", handler) and friends — register an operation without the verbose
huma.Register(api, huma.Operation{...}, handler) literal. The verb
is the method name; the path is the SECOND argument (the first is
the API/group). Mapped here so the call walker can decode them
alongside huma.Register.
Class methods
Instance methods
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.