Documentation
¶
Overview ¶
Package nethttp adapts the framework-agnostic oapi core onto the net/http standard library (Go 1.22+ method-aware ServeMux patterns). Register oapi routes with Register / RegisterAll and serve the OpenAPI document with SpecHandler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultMaxRequestBytes int64 = 10 << 20 // 10 MiB
DefaultMaxRequestBytes caps how many bytes the adapter reads from a request body (JSON, urlencoded and multipart), guarding against memory/disk exhaustion from oversized uploads. Set it to 0 to disable the cap (e.g. when you enforce limits with your own middleware). Override before registering routes.
Functions ¶
func Register ¶
func Register(mux *http.ServeMux, route oapi.Route, native ...Middleware)
Register mounts a single oapi.Route on a ServeMux using a method-aware pattern. Optional native middlewares wrap the route handler.
func RegisterAll ¶
RegisterAll mounts every route on the mux.
func SpecHandler ¶
func SpecHandler(reg *oapi.Registry) http.HandlerFunc
SpecHandler serves a registry's OpenAPI document as JSON, built once.