Versions in this module Expand all Collapse all v1 v1.0.0 Dec 8, 2025 Changes in this version + var ErrSecurityAPIKeyInInvalid = fmt.Errorf("apiKey 'in' must be one of: header, query, cookie") + var ErrSecurityAPIKeyInRequired = fmt.Errorf("apiKey security scheme requires 'in' field") + var ErrSecurityAPIKeyNameRequired = fmt.Errorf("apiKey security scheme requires 'name' field") + var ErrSecurityHTTPSchemeRequired = fmt.Errorf("http security scheme requires 'scheme' field") + var ErrSecurityOAuth2FlowsRequired = fmt.Errorf("oauth2 security scheme requires 'flows'") + var ErrSecurityOpenIDConnectURLRequired = fmt.Errorf("openIdConnect security scheme requires 'openIdConnectUrl'") + var ErrSecurityTypeInvalid = fmt.Errorf("invalid security scheme type") + var ErrSecurityTypeRequired = fmt.Errorf("security scheme type is required") + func ErrDuplicatePath(path string, method string) error + func ErrEmptyTypeName(typePath string) error + func ErrInvalidPath(path string, reason string) error + func ErrParameterNotFound(paramName string, paramType string) error + func ErrSecuritySchemeNotFound(name string) error + func ErrTypeNameCollision(typeName string, types []string) error + func ExtractRequestTypeFromHandler(handler any) (reflect.Type, error) + func GetEndpointRegistry() *registryStore + func GetHandlerName(handler any) string + func ValidateSecurityRequirement(schemeNames []string, schemes SecuritySchemes) error + type Components struct + Headers map[string]*Header + Parameters map[string]*Parameter + RequestBodies map[string]*RequestBody + Responses map[string]*Response + Schemas map[string]*Schema + SecuritySchemes SecuritySchemes + type Contact struct + Email string + Name string + URL string + type EndpointSpec struct + ContentType string + Description string + Method string + OperationID string + Path string + Responses []ResponseSpec + Security string + Summary string + Tags []string + type FieldInfo struct + JSONTag string + Location FieldLocation + Name string + Type reflect.Type + type FieldLocation string + const LocationBody + const LocationHeader + const LocationPath + const LocationQuery + type Header struct + Description string + Required bool + Schema *Schema + type Info struct + Contact *Contact + Description string + License *License + TermsOfService string + Title string + Version string + type License struct + Name string + URL string + type MediaType struct + Example interface{} + Examples map[string]interface{} + Schema *SchemaRef + type OAuthFlow struct + AuthorizationURL string + RefreshURL string + Scopes map[string]string + TokenURL string + type OAuthFlows struct + AuthorizationCode *OAuthFlow + ClientCredentials *OAuthFlow + Implicit *OAuthFlow + Password *OAuthFlow + type Operation struct + Deprecated bool + Description string + OperationID string + Parameters []*Parameter + RequestBody *RequestBody + Responses map[string]*Response + Security []SecurityRequirement + Summary string + Tags []string + type Par struct + Name string + Pipe PipeFn[Out] + Type string + type Parameter struct + Deprecated bool + Description string + In string + Name string + Required bool + Schema *Schema + type PathItem struct + Delete *Operation + Description string + Get *Operation + Head *Operation + Options *Operation + Parameters []*Parameter + Patch *Operation + Post *Operation + Put *Operation + Summary string + type PipeFn func(string) (Out, error) + type RegisteredEndpoint struct + ContentType string + Description string + HandlerName string + Method string + OperationID string + Path string + RequestInfo *RequestStructInfo + RequestType reflect.Type + ResponseType reflect.Type + Responses []ResponseSpec + Security string + Summary string + Tags []string + type RequestBody struct + Content map[string]*MediaType + Description string + Required bool + type RequestStructInfo struct + Fields map[FieldLocation][]*FieldInfo + Type reflect.Type + func AnalyzePlainRequestStructure(requestType reflect.Type) (*RequestStructInfo, error) + func AnalyzeRequestStructure(requestType reflect.Type) (*RequestStructInfo, error) + type Response struct + Content map[string]*MediaType + Description string + Headers map[string]*Header + type ResponseShortSpec struct + ContentType string + Description string + Model any + StatusCode int + type ResponseSpec struct + ContentType string + Description string + Model any + StatusCode int + type Schema struct + AdditionalProperties *Schema + AllOf []*SchemaRef + AnyOf []*SchemaRef + Default any + Description string + Enum []any + Example any + Format string + Items *SchemaRef + MaxItems *int + MaxLength *int + Maximum *float64 + MinItems *int + MinLength *int + Minimum *float64 + Not *SchemaRef + OneOf []*SchemaRef + Pattern string + Properties map[string]*SchemaRef + Ref string + Required []string + Title string + Type string + func (s Schema) GetName() string + type SchemaRef struct + Ref string + Value *Schema + type SecurityRequirement map[string][]string + type SecurityScheme struct + BearerFormat string + Description string + Flows *OAuthFlows + In string + Name string + OpenIDConnectURL string + Scheme string + Type string + func (s *SecurityScheme) Validate() error + type SecuritySchemes map[string]*SecurityScheme + type Server struct + Description string + URL string + Variables map[string]*ServerVariable + type ServerVariable struct + Default string + Description string + Enum []string + type Specification struct + Components *Components + Info *Info + OpenAPI string + Paths map[string]*PathItem + Servers []*Server + func BuildCoreSpecification(info *Info, servers ...*Server) (*Specification, error) + func NewSpecification(openAPIVersion string, info *Info) *Specification + func (s *Specification) AddPath(path string, pathItem *PathItem) + func (s *Specification) AddSecurityScheme(name string, scheme *SecurityScheme) error + func (s *Specification) AddServer(server *Server) + func (s *Specification) Validate() error