Versions in this module Expand all Collapse all v0 v0.3.2 Jun 26, 2025 v0.3.1 Jun 26, 2025 Changes in this version type Generator + func NewBasicGenerator(title, description, version string) *Generator v0.3.0 Jun 26, 2025 Changes in this version + const Version + func AuthEndpoints(generator *Generator) error + func BoolPtr(b bool) *bool + func CRUDEndpoints(generator *Generator, basePath string, resourceType reflect.Type, ...) error + func CommonHeaders() map[string]HeaderInfo + func ExampleUsage() + func Float64Ptr(f float64) *float64 + func GenerateAndServe(generator *Generator, port int) error + func GenerateExample(schema Schema) interface + func GeneratedAt() string + func HTTPMethodFromString(method string) string + func HealthCheckEndpoint(generator *Generator) error + func IntPtr(i int) *int + func IsValidHTTPMethod(method string) bool + func Middleware(generator *Generator) func(http.Handler) http.Handler + func StandardResponses() map[int]ResponseInfo + func StringPtr(s string) *string + func ValidateRequest(generator *Generator, method, path string, body interface{}) error + func ValidateSchema(schema Schema) error + type Callback map[string]PathItem + type Components struct + Callbacks map[string]Callback + Examples map[string]Example + Headers map[string]Header + Links map[string]Link + Parameters map[string]Parameter + RequestBodies map[string]RequestBody + Responses map[string]Response + Schemas map[string]Schema + SecuritySchemes map[string]SecurityScheme + type Config struct + Contact *Contact + CustomTypeMapping map[reflect.Type]Schema + Description string + ExternalDocs *ExternalDocumentation + GenerateHTML bool + GenerateJSON bool + GenerateYAML bool + GlobalSecurity []SecurityRequirement + IncludeExamples bool + License *License + OutputDir string + PrettyPrint bool + SecuritySchemes map[string]SecurityScheme + Servers []Server + Tags []Tag + TermsOfService string + Title string + UseReferences bool + ValidateSchemas bool + Version string + func DefaultConfig() Config + type Contact struct + Email string + Name string + URL string + type Encoding struct + AllowReserved bool + ContentType string + Explode *bool + Headers map[string]Header + Style string + type EndpointBuilder struct + func NewEndpointBuilder() *EndpointBuilder + func RESTEndpoint(method, path, summary string, resourceType reflect.Type) *EndpointBuilder + func SimpleEndpoint(method, path, summary string) *EndpointBuilder + func (eb *EndpointBuilder) Build() EndpointOptions + func (eb *EndpointBuilder) ConvertToOperation() Operation + func (eb *EndpointBuilder) Deprecated() *EndpointBuilder + func (eb *EndpointBuilder) Description(description string) *EndpointBuilder + func (eb *EndpointBuilder) HeaderParam(name, description string, required bool, t reflect.Type) *EndpointBuilder + func (eb *EndpointBuilder) OperationID(id string) *EndpointBuilder + func (eb *EndpointBuilder) PathParam(name, description string, t reflect.Type) *EndpointBuilder + func (eb *EndpointBuilder) QueryParam(name, description string, required bool, t reflect.Type) *EndpointBuilder + func (eb *EndpointBuilder) RequestBody(description string, required bool, contentType string, t reflect.Type) *EndpointBuilder + func (eb *EndpointBuilder) RequestExample(example interface{}) *EndpointBuilder + func (eb *EndpointBuilder) RequestType(t reflect.Type) *EndpointBuilder + func (eb *EndpointBuilder) Response(statusCode int, description, contentType string, t reflect.Type) *EndpointBuilder + func (eb *EndpointBuilder) ResponseExample(example interface{}) *EndpointBuilder + func (eb *EndpointBuilder) ResponseHeader(statusCode int, name, description string, t reflect.Type) *EndpointBuilder + func (eb *EndpointBuilder) ResponseType(t reflect.Type) *EndpointBuilder + func (eb *EndpointBuilder) Security(requirements ...SecurityRequirement) *EndpointBuilder + func (eb *EndpointBuilder) Summary(summary string) *EndpointBuilder + func (eb *EndpointBuilder) Tags(tags ...string) *EndpointBuilder + type EndpointOptions struct + Deprecated bool + Description string + HeaderParams []ParameterInfo + OperationID string + PathParams []ParameterInfo + QueryParams []ParameterInfo + RequestBody *RequestBodyInfo + RequestExample interface{} + RequestType reflect.Type + ResponseExample interface{} + ResponseType reflect.Type + Responses map[int]ResponseInfo + Security []SecurityRequirement + Summary string + Tags []string + type ErrorResponse struct + Code int + Details string + Error string + type Example struct + Description string + ExternalValue string + Summary string + Value interface{} + type ExternalDocumentation struct + Description string + URL string + type Generator struct + func NewGenerator(config Config) *Generator + func QuickStart(title, description, version string) *Generator + func (g *Generator) AddCustomParameter(name string, parameter Parameter) + func (g *Generator) AddCustomResponse(name string, response Response) + func (g *Generator) AddCustomSchema(name string, schema Schema) + func (g *Generator) AddEndpoint(method, path string, options EndpointOptions) error + func (g *Generator) AddEndpointWithBuilder(method, path string, builder *EndpointBuilder) error + func (g *Generator) AddGlobalSecurity(requirements ...SecurityRequirement) + func (g *Generator) AddSecurityScheme(name string, scheme SecurityScheme) + func (g *Generator) AddServer(server Server) + func (g *Generator) AddTag(tag Tag) + func (g *Generator) Clone() *Generator + func (g *Generator) GenerateSpec() (*OpenAPISpec, error) + func (g *Generator) GetEndpoint(method, path string) (EndpointOptions, bool) + func (g *Generator) GetOutputPath(filename string) string + func (g *Generator) GetSchemaGenerator() *SchemaGenerator + func (g *Generator) GetSpec() *OpenAPISpec + func (g *Generator) GetStatistics() Statistics + func (g *Generator) ListEndpoints() map[string][]string + func (g *Generator) Merge(other *Generator) error + func (g *Generator) RemoveEndpoint(method, path string) + func (g *Generator) Reset() + func (g *Generator) SetExternalDocs(docs ExternalDocumentation) + func (g *Generator) UpdateInfo(info Info) + type Header struct + AllowEmptyValue bool + AllowReserved bool + Content map[string]MediaType + Deprecated bool + Description string + Example interface{} + Examples map[string]Example + Explode *bool + Required bool + Schema *Schema + Style string + type HeaderInfo struct + Description string + Example interface{} + Schema *Schema + Type reflect.Type + type Info struct + Contact *Contact + Description string + License *License + TermsOfService string + Title string + Version string + type License struct + Name string + URL string + type Link struct + Description string + OperationID string + OperationRef string + Parameters map[string]interface{} + RequestBody interface{} + Server *Server + type MediaType struct + Encoding map[string]Encoding + Example interface{} + Examples map[string]Example + Schema *Schema + 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 OpenAPISpec struct + Components *Components + ExternalDocs *ExternalDocumentation + Info Info + OpenAPI string + Paths map[string]PathItem + Security []SecurityRequirement + Servers []Server + Tags []Tag + func NewOpenAPISpec() *OpenAPISpec + func (spec *OpenAPISpec) ToJSON() ([]byte, error) + type Operation struct + Callbacks map[string]Callback + Deprecated bool + Description string + ExternalDocs *ExternalDocumentation + OperationID string + Parameters []Parameter + RequestBody *RequestBody + Responses map[string]Response + Security []SecurityRequirement + Servers []Server + Summary string + Tags []string + type PaginatedResponse struct + Data interface{} + Page int + PerPage int + Total int + TotalPages int + type Parameter struct + AllowEmptyValue bool + AllowReserved bool + Content map[string]MediaType + Deprecated bool + Description string + Example interface{} + Examples map[string]Example + Explode *bool + In string + Name string + Required bool + Schema *Schema + Style string + type ParameterInfo struct + Description string + Example interface{} + Name string + Required bool + Schema *Schema + Type reflect.Type + func FilterParams() []ParameterInfo + func PaginationParams() []ParameterInfo + type PathItem struct + Delete *Operation + Description string + Get *Operation + Head *Operation + Options *Operation + Parameters []Parameter + Patch *Operation + Post *Operation + Put *Operation + Ref string + Servers []Server + Summary string + Trace *Operation + type RequestBody struct + Content map[string]MediaType + Description string + Required bool + type RequestBodyInfo struct + ContentType string + Description string + Example interface{} + Required bool + Schema *Schema + Type reflect.Type + type Response struct + Content map[string]MediaType + Description string + Headers map[string]Header + Links map[string]Link + type ResponseInfo struct + ContentType string + Description string + Example interface{} + Headers map[string]HeaderInfo + Schema *Schema + Type reflect.Type + type Schema struct + AdditionalProperties interface{} + AllOf []Schema + AnyOf []Schema + Default interface{} + Deprecated *bool + Description string + Enum []interface{} + Example interface{} + ExclusiveMaximum *bool + ExclusiveMinimum *bool + ExternalDocs *ExternalDocumentation + Format string + Items *Schema + MaxItems *int + MaxLength *int + MaxProperties *int + Maximum *float64 + MinItems *int + MinLength *int + MinProperties *int + Minimum *float64 + MultipleOf *float64 + Not *Schema + OneOf []Schema + Pattern string + Properties map[string]Schema + ReadOnly *bool + Ref string + Required []string + Title string + Type string + UniqueItems *bool + WriteOnly *bool + XML *XML + type SchemaGenerator struct + func NewSchemaGenerator() *SchemaGenerator + func (sg *SchemaGenerator) GenerateSchema(t reflect.Type) Schema + func (sg *SchemaGenerator) GenerateSchemaFromValue(v interface{}) Schema + func (sg *SchemaGenerator) GenerateSchemaWithName(t reflect.Type, name string) Schema + func (sg *SchemaGenerator) GetSchemas() map[string]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 + type Server struct + Description string + URL string + Variables map[string]ServerVariable + type ServerVariable struct + Default string + Description string + Enum []string + type Statistics struct + EndpointsByMethod map[string]int + EndpointsByTag map[string]int + TotalEndpoints int + TotalSchemas int + type SuccessResponse struct + Data interface{} + Message string + type Tag struct + Description string + ExternalDocs *ExternalDocumentation + Name string + type Writer struct + func NewWriter(generator *Generator) *Writer + func (w *Writer) CleanOutputDir() error + func (w *Writer) GenerateMarkdownDocs() error + func (w *Writer) GetGeneratedFiles() []string + func (w *Writer) WatchAndRegenerate(interval time.Duration, callback func() error) + func (w *Writer) WriteFiles() error + func (w *Writer) WriteHTML(spec *OpenAPISpec) error + func (w *Writer) WriteJSON(spec *OpenAPISpec) error + func (w *Writer) WriteToFile(filename string, format string) error + func (w *Writer) WriteYAML(spec *OpenAPISpec) error + type XML struct + Attribute bool + Name string + Namespace string + Prefix string + Wrapped bool