Documentation
¶
Overview ¶
Package gin adapts the framework-agnostic oapi core onto the gin web framework. Register oapi routes with Register / RegisterAll and serve the generated 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 ¶
Register mounts a single oapi.Route on a gin router. Optional native gin middlewares run before the route handler; an aborting middleware skips it.
func RegisterAll ¶
RegisterAll mounts every route on the router.
func SpecHandler ¶
func SpecHandler(reg *oapi.Registry) gin.HandlerFunc
SpecHandler serves a registry's OpenAPI document as JSON. The document is built once on first request.
Types ¶
This section is empty.