Versions in this module Expand all Collapse all v1 v1.3.1 Nov 17, 2026 v1.3.0 Nov 17, 2026 v1.2.0 Nov 8, 2026 Changes in this version + const DefsPrefix + const MaxSpecSize + var ErrInvalid = errors.New("openapi: invalid spec") + var ErrNotGenerated = errors.New("openapi: a file to write is not one generated from this spec") + var ErrNotOpenAPI = errors.New("openapi: not an OpenAPI or Swagger document") + var ErrTooLarge = errors.New("openapi: the spec is too large") + var SchemaMapKeywords = []string + var ValueKeywords = []string + func Detect(data []byte) (string, error) + func IsJSON(mediaType string) bool + func Location(in string) (*url.URL, error) + func Read(ctx context.Context, client *http.Client, u *url.URL) ([]byte, error) + func RequestRoots(defs map[string]any, schemas []any) []map[string]any + func RouteFirst(m *Mock) string + type Content struct + Examples []Example + MediaType string + Schema any + type Document struct + Defs map[string]any + Operations []Operation + Spec any + Title string + type Example struct + Name string + Serialized bool + Value any + type File struct + Data any + Mocks []Mock + Name string + func Generate(ctx context.Context, doc *Document, log *zerolog.Logger) ([]File, error) + func PerMock(mocks []Mock) []File + type Header struct + Examples []Example + Explode bool + MediaType string + Name string + Schema any + type Layout func(mocks []Mock) []File + type Mock struct + Enabled bool + ID string + MediaType string + Method string + Name string + Priority int + Reply Reply + Request Request + Route string + Status string + Variant string + type Namer func(m *Mock) string + type Operation struct + BasePath string + Challenges []string + Consumes []string + HasInput bool + ID string + Method string + Path string + PathParams []Parameter + Responses []Response + Secured bool + Summary string + type Parameter struct + Examples []Example + Explode bool + MediaType string + Name string + Style string + type Reply struct + Body any + BodyBase64 string + Header map[string]string + Status int + Template bool + type Report struct + Stale []string + Written []string + func Write(dir, title string, files []File) (*Report, error) + type Request struct + Accept []any + Custom []any + Method any + Path any + PathTemplate string + type Response struct + Content []Content + Headers []Header + Status string