Documentation ¶
Index ¶
- type AsyncAPIDocument
- type AsyncAPIInfo
- type AsyncAPIValidator
- type BlueprintAction
- type BlueprintDocument
- type BlueprintExample
- type BlueprintMessage
- type BlueprintParameter
- type BlueprintResource
- type BlueprintResourceGroup
- type BlueprintValidator
- type Channel
- type Components
- type GraphQLValidator
- type Message
- type OAuthFlow
- type OpenAPI3Validator
- type Operation
- type RAMLDocument
- type RAMLMethod
- type RAMLResource
- type RAMLResponse
- type RAMLValidator
- type SecurityScheme
- type Server
- type SpecFormat
- type SpecInfo
- type Swagger2Validator
- type ValidationError
- type ValidationResult
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncAPIDocument ¶
type AsyncAPIDocument struct { AsyncAPI string `json:"asyncapi" yaml:"asyncapi"` Info AsyncAPIInfo `json:"info" yaml:"info"` Channels map[string]Channel `json:"channels" yaml:"channels"` Components *Components `json:"components,omitempty" yaml:"components,omitempty"` Servers map[string]Server `json:"servers,omitempty" yaml:"servers,omitempty"` }
AsyncAPIDocument represents an AsyncAPI specification
type AsyncAPIInfo ¶
type AsyncAPIValidator ¶
type AsyncAPIValidator struct {
// contains filtered or unexported fields
}
AsyncAPIValidator handles AsyncAPI specification validation
func NewAsyncAPIValidator ¶
func NewAsyncAPIValidator(logger *logrus.Logger) *AsyncAPIValidator
NewAsyncAPIValidator creates a new AsyncAPI validator instance
func (*AsyncAPIValidator) Validate ¶
func (v *AsyncAPIValidator) Validate(specPath string) (*ValidationResult, error)
Validate validates an AsyncAPI specification
type BlueprintAction ¶
type BlueprintAction struct { Name string Method string Description string Parameters []BlueprintParameter Headers map[string]string Examples []BlueprintExample }
BlueprintAction represents an API Blueprint action (HTTP method)
type BlueprintDocument ¶
type BlueprintDocument struct { Format string Version string Host string Title string Description string Groups []BlueprintResourceGroup }
BlueprintDocument represents an API Blueprint document
type BlueprintExample ¶
type BlueprintExample struct { Name string Description string Request BlueprintMessage Response BlueprintMessage }
BlueprintExample represents an API Blueprint request/response example
type BlueprintMessage ¶
BlueprintMessage represents an API Blueprint request or response
type BlueprintParameter ¶
BlueprintParameter represents an API Blueprint parameter
type BlueprintResource ¶
type BlueprintResource struct { Name string Description string URITemplate string Actions []BlueprintAction }
BlueprintResource represents an API Blueprint resource
type BlueprintResourceGroup ¶
type BlueprintResourceGroup struct { Name string Description string Resources []BlueprintResource }
BlueprintResourceGroup represents a group of resources in API Blueprint
type BlueprintValidator ¶
type BlueprintValidator struct {
// contains filtered or unexported fields
}
BlueprintValidator handles API Blueprint specification validation
func NewBlueprintValidator ¶
func NewBlueprintValidator(logger *logrus.Logger) *BlueprintValidator
NewBlueprintValidator creates a new API Blueprint validator instance
func (*BlueprintValidator) Validate ¶
func (v *BlueprintValidator) Validate(specPath string) (*ValidationResult, error)
Validate validates an API Blueprint specification
type Components ¶
type Components struct { Messages map[string]Message `json:"messages,omitempty" yaml:"messages,omitempty"` SecuritySchemes map[string]SecurityScheme `json:"securitySchemes,omitempty" yaml:"securitySchemes,omitempty"` }
type GraphQLValidator ¶
type GraphQLValidator struct {
// contains filtered or unexported fields
}
GraphQLValidator handles GraphQL schema validation
func NewGraphQLValidator ¶
func NewGraphQLValidator(logger *logrus.Logger) *GraphQLValidator
NewGraphQLValidator creates a new GraphQL validator instance
func (*GraphQLValidator) Validate ¶
func (v *GraphQLValidator) Validate(schemaPath string) (*ValidationResult, error)
Validate validates a GraphQL schema
type Message ¶
type Message struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Title string `json:"title,omitempty" yaml:"title,omitempty"` Summary string `json:"summary,omitempty" yaml:"summary,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Payload map[string]interface{} `json:"payload,omitempty" yaml:"payload,omitempty"` }
type OAuthFlow ¶
type OAuthFlow struct { Type string AuthorizationURL string TokenURL string RefreshURL string Scopes map[string]string }
OAuthFlow represents OAuth flow configuration
type OpenAPI3Validator ¶
type OpenAPI3Validator struct {
// contains filtered or unexported fields
}
OpenAPI3Validator handles OpenAPI 3.0 specification validation
func NewOpenAPI3Validator ¶
func NewOpenAPI3Validator(logger *logrus.Logger) *OpenAPI3Validator
NewOpenAPI3Validator creates a new OpenAPI 3.0 validator instance
func (*OpenAPI3Validator) Validate ¶
func (v *OpenAPI3Validator) Validate(specPath string) (*ValidationResult, error)
Validate validates an OpenAPI 3.0 specification
type Operation ¶
type Operation struct { Summary string `json:"summary,omitempty" yaml:"summary,omitempty"` Description string `json:"description,omitempty" yaml:"description,omitempty"` Message *Message `json:"message,omitempty" yaml:"message,omitempty"` Security []map[string][]string `json:"security,omitempty" yaml:"security,omitempty"` }
type RAMLDocument ¶
type RAMLDocument struct { Title string `yaml:"title"` Version string `yaml:"version"` BaseURI string `yaml:"baseUri"` MediaType string `yaml:"mediaType"` SecuritySchemes map[string]SecurityScheme `yaml:"securitySchemes"` Types map[string]interface{} `yaml:"types"` Resources map[string]RAMLResource `yaml:"resources"` }
RAMLDocument represents a RAML specification
type RAMLMethod ¶
type RAMLMethod struct { Description string `yaml:"description"` Headers map[string]interface{} `yaml:"headers"` QueryParams map[string]interface{} `yaml:"queryParameters"` Body map[string]interface{} `yaml:"body"` Responses map[string]RAMLResponse `yaml:"responses"` }
RAMLMethod represents a RAML method
type RAMLResource ¶
type RAMLResource struct { Description string `yaml:"description"` Methods map[string]RAMLMethod `yaml:"methods"` Resources map[string]RAMLResource `yaml:"resources"` }
RAMLResource represents a RAML resource
type RAMLResponse ¶
type RAMLResponse struct { Description string `yaml:"description"` Headers map[string]interface{} `yaml:"headers"` Body map[string]interface{} `yaml:"body"` }
RAMLResponse represents a RAML response
type RAMLValidator ¶
type RAMLValidator struct {
// contains filtered or unexported fields
}
RAMLValidator handles RAML specification validation
func NewRAMLValidator ¶
func NewRAMLValidator(logger *logrus.Logger) *RAMLValidator
NewRAMLValidator creates a new RAML validator instance
func (*RAMLValidator) Validate ¶
func (v *RAMLValidator) Validate(specPath string) (*ValidationResult, error)
Validate validates a RAML specification
type SecurityScheme ¶
type SecurityScheme struct { Type string Name string Description string Location string Flows []OAuthFlow }
SecurityScheme represents a generic security scheme
type SpecFormat ¶
type SpecFormat string
SpecFormat represents the API specification format
const ( FormatSwagger2 SpecFormat = "swagger2" FormatOpenAPI3 SpecFormat = "openapi3" FormatAsyncAPI SpecFormat = "asyncapi" FormatGraphQL SpecFormat = "graphql" FormatRAML SpecFormat = "raml" FormatBlueprint SpecFormat = "blueprint" )
type SpecInfo ¶
type SpecInfo struct { Title string Version string Description string Format SpecFormat }
SpecInfo contains basic information about an API specification
type Swagger2Validator ¶
type Swagger2Validator struct {
// contains filtered or unexported fields
}
Swagger2Validator handles Swagger 2.0 specification validation
func NewSwagger2Validator ¶
func NewSwagger2Validator(logger *logrus.Logger) *Swagger2Validator
NewSwagger2Validator creates a new Swagger 2.0 validator instance
func (*Swagger2Validator) Validate ¶
func (v *Swagger2Validator) Validate(specPath string) (*ValidationResult, error)
Validate validates a Swagger 2.0 specification
type ValidationError ¶
type ValidationError struct { Path string Message string Severity string Suggestion string LineNumber int ColumnStart int ColumnEnd int }
ValidationError represents a validation error
type ValidationResult ¶
type ValidationResult struct { Valid bool Errors []ValidationError Info SpecInfo Paths []string Methods []string }
ValidationResult contains the results of specification validation
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator handles API specification validation
func (*Validator) ValidateSpec ¶
ValidateSpec validates an API specification file