gen

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAuth

func GenerateAuth(w io.Writer, api *spec.OpenAPI, pkg string) error

GenerateAuth writes the authentication helpers file. The generic helpers (BasicAuth, BearerToken, APIKey, …) are emitted unconditionally; when the spec defines components.securitySchemes, one typed wrapper per scheme is also emitted so call sites match spec naming.

func GenerateBodyTypes

func GenerateBodyTypes(w io.Writer, api *spec.OpenAPI, pkg string) error

GenerateBodyTypes writes inline request body structs (for operations whose requestBody schema is not a $ref to a named component).

func GenerateClient

func GenerateClient(w io.Writer, api *spec.OpenAPI, pkg string) error

GenerateClient writes the HTTP client file.

func GenerateServer

func GenerateServer(w io.Writer, api *spec.OpenAPI, pkg string) error

GenerateServer writes the server interface + chi handler registration file.

func GenerateTypes

func GenerateTypes(w io.Writer, api *spec.OpenAPI, pkg string) error

GenerateTypes writes the types/models Go file.

Types

type MethodOp

type MethodOp struct {
	Method string
	Path   string
	Op     *spec.Operation
}

MethodOp pairs an HTTP method and URL path with its resolved Operation. It is the unit of iteration used by the code generators.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL