Documentation
¶
Index ¶
- type Generator
- func (g *Generator) Add(method, path string, opts ...option.OperationOption)
- func (g *Generator) Config() *openapi.Config
- func (g *Generator) Delete(path string, opts ...option.OperationOption)
- func (g *Generator) GenerateSchema(formats ...string) ([]byte, error)
- func (g *Generator) Get(path string, opts ...option.OperationOption)
- func (g *Generator) Head(path string, opts ...option.OperationOption)
- func (g *Generator) Options(path string, opts ...option.OperationOption)
- func (g *Generator) Patch(path string, opts ...option.OperationOption)
- func (g *Generator) Post(path string, opts ...option.OperationOption)
- func (g *Generator) Put(path string, opts ...option.OperationOption)
- func (g *Generator) Trace(path string, opts ...option.OperationOption)
- func (g *Generator) Validate() error
- func (g *Generator) WriteSchemaTo(path string) error
- type SpecError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator is responsible for generating OpenAPI documentation.
func NewGenerator ¶
func NewGenerator(opts ...option.OpenAPIOption) *Generator
NewGenerator creates a new Generator instance with the provided configuration.
func (*Generator) Add ¶ added in v0.1.2
func (g *Generator) Add(method, path string, opts ...option.OperationOption)
Add registers a new operation with the specified method and path. It applies the provided operation options to the operation context.
func (*Generator) Config ¶ added in v0.1.2
Config returns the OpenAPI configuration used by the Generator.
func (*Generator) Delete ¶ added in v0.1.2
func (g *Generator) Delete(path string, opts ...option.OperationOption)
Delete registers a new DELETE operation with the specified path and options.
func (*Generator) GenerateSchema ¶
GenerateSchema generates the OpenAPI schema in the specified format (JSON or YAML).
By default, it generates YAML. If "json" is specified, it generates JSON.
func (*Generator) Get ¶ added in v0.1.2
func (g *Generator) Get(path string, opts ...option.OperationOption)
Get registers a new GET operation with the specified path and options.
func (*Generator) Head ¶ added in v0.1.2
func (g *Generator) Head(path string, opts ...option.OperationOption)
Head registers a new HEAD operation with the specified path and options.
func (*Generator) Options ¶ added in v0.1.2
func (g *Generator) Options(path string, opts ...option.OperationOption)
Options registers a new OPTIONS operation with the specified path and options.
func (*Generator) Patch ¶ added in v0.1.2
func (g *Generator) Patch(path string, opts ...option.OperationOption)
Patch registers a new PATCH operation with the specified path and options.
func (*Generator) Post ¶ added in v0.1.2
func (g *Generator) Post(path string, opts ...option.OperationOption)
Post registers a new POST operation with the specified path and options.
func (*Generator) Put ¶ added in v0.1.2
func (g *Generator) Put(path string, opts ...option.OperationOption)
Put registers a new PUT operation with the specified path and options.
func (*Generator) Trace ¶ added in v0.1.2
func (g *Generator) Trace(path string, opts ...option.OperationOption)
Trace registers a new TRACE operation with the specified path and options.
func (*Generator) Validate ¶ added in v0.1.2
Validate checks if the generated OpenAPI specification is valid.
func (*Generator) WriteSchemaTo ¶
WriteSchemaTo writes the OpenAPI schema to the specified file path.
The file format is determined by the file extension: ".json" for JSON and ".yaml" for YAML.
type SpecError ¶ added in v0.1.2
type SpecError struct {
// contains filtered or unexported fields
}
SpecError is a thread-safe error collector for OpenAPI specifications.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
adapter
|
|
|
chiopenapi
module
|
|
|
echoopenapi
module
|
|
|
fiberopenapi
module
|
|
|
ginopenapi
module
|
|
|
httpopenapi
module
|
|
|
httprouteropenapi
module
|
|
|
muxopenapi
module
|
|
|
adapters
|
|
|
chiopenapi
module
|
|
|
echoopenapi
module
|
|
|
fiberopenapi
module
|
|
|
ginopenapi
module
|
|
|
httpopenapi
module
|
|
|
internal
|
|
|
module
|
|
|
specui
module
|
|
|
pkg
|
|