Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter interface {
Export(ctx context.Context, spec *model.Spec, cfg ExporterConfig) (*ExporterResult, error)
IsSupportedVersion(version string) bool
}
func NewExporter ¶
func NewExporter(adapters []ViewAdapter) Exporter
type ExporterConfig ¶
type ExporterResult ¶
type ExporterResult struct {
// Result is the marshaled OpenAPI specification as bytes.
Result []byte
// Warnings contains any warnings generated during projection.
// Warnings are generated when features are not supported by the target version.
Warnings debug.Warnings
}
Result contains the output of spec projection.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates OpenAPI specifications against a specific meta-schema. Each validator instance is tied to a specific OpenAPI version.
func NewValidator ¶
New creates a new version-specific Validator with the provided meta-schema JSON.
The validator uses santhosh-tekuri/jsonschema which supports both JSON Schema draft-04 (for OpenAPI 3.0) and draft-2020-12 (for OpenAPI 3.1).
Example:
validator, err := validator.New(schemaJSON)
if err != nil {
log.Fatalf("Failed to create validator: %v", err)
}
Click to show internal directories.
Click to hide internal directories.