infer

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizePath

func NormalizePath(path string) string

NormalizePath ensures the stored path matches OpenAPI style. It converts common router syntaxes:

/users/:id   -> /users/{id}
/users/<id>  -> /users/{id} (optional - not used today)

func PathParams

func PathParams(path string) []string

PathParams extracts OpenAPI style path params from /users/{id}.

func RequestSchema

func RequestSchema(doc *openapi3.T, sample interface{}) *openapi3.SchemaRef

func ResponseSchema

func ResponseSchema(doc *openapi3.T, sample interface{}) *openapi3.SchemaRef

func SchemaFrom

func SchemaFrom(doc *openapi3.T, sample interface{}) *openapi3.SchemaRef

SchemaFrom adds schema components to doc (if needed) and returns a SchemaRef.

sample is typically a zero value of the struct (User{}) or slice ([]User{}).

Types

This section is empty.

Jump to

Keyboard shortcuts

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