openapi

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OpenAPIGenerator

type OpenAPIGenerator struct {
	Store *snapshot.SnapshotStore
}

OpenAPIGenerator builds an OpenAPI 3.0 spec from recorded snapshots.

func NewOpenAPIGenerator

func NewOpenAPIGenerator(store *snapshot.SnapshotStore) *OpenAPIGenerator

NewOpenAPIGenerator creates an OpenAPIGenerator backed by the given store.

func (*OpenAPIGenerator) Generate

func (g *OpenAPIGenerator) Generate() (map[string]interface{}, error)

Generate reads all snapshots and produces an OpenAPI 3.0 spec as a nested map.

func (*OpenAPIGenerator) InferPathParams

func (g *OpenAPIGenerator) InferPathParams(urls []string) []PathTemplate

InferPathParams takes a list of URL paths with the same segment count and detects segments that vary across the set, replacing them with parameter placeholders.

func (*OpenAPIGenerator) WriteYAML

func (g *OpenAPIGenerator) WriteYAML(w io.Writer) error

WriteYAML generates the OpenAPI spec and writes it as YAML to w.

type PathTemplate

type PathTemplate struct {
	Template string   // e.g., "/users/{id}"
	Params   []string // e.g., ["id"]
}

PathTemplate represents a parameterized URL path.

Jump to

Keyboard shortcuts

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