Documentation ¶
Index ¶
- Variables
- func LintOpenAPIValidator(filename string)
- func LintSpectral(filename string)
- type EMessage
- type ErrorResult
- type IBMLint
- type Linter
- type Message
- func (*Message) Descriptor() ([]byte, []int)deprecated
- func (x *Message) GetKeys() []string
- func (x *Message) GetLine() int32
- func (x *Message) GetMessage() string
- func (x *Message) GetSuggestion() string
- func (x *Message) GetType() string
- func (*Message) ProtoMessage()
- func (x *Message) ProtoReflect() protoreflect.Message
- func (x *Message) Reset()
- func (x *Message) String() string
- type WMessage
- type WarningResult
Constants ¶
This section is empty.
Variables ¶
var File_linter_proto protoreflect.FileDescriptor
Functions ¶
func LintOpenAPIValidator ¶
func LintOpenAPIValidator(filename string)
LintOpenapiValidator functions serves as a linter results translater. The function takes the filename which contains the json results of IBM's openapi-validator and creates a new instance of the linter struct using the JSON data.
func LintSpectral ¶
func LintSpectral(filename string)
LintSpectral functions serves as a linter results translater. The function takes the filename which contains the text results of Stoplights's spectral and creates a new instance of the linter struct using the text data.
Types ¶
type ErrorResult ¶
type IBMLint ¶
type IBMLint struct { LinterErrors ErrorResult `json:"errors"` LinterWarnings WarningResult `json:"warnings"` }
The Lint struct is used to parse the structured json data from the IBM linter output. Documentation for IBM's openapi-validator results: https://github.com/IBM/openapi-validator#validation-results
type Linter ¶
type Linter struct { Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` // contains filtered or unexported fields }
func AIPLintV2 ¶
AIPLintV2 accepts an OpenAPI v2 document and will call the individual AIP rules on the document.
func AIPLintV3 ¶
func AIPLintV3(document *openapi_v3.Document) (*Linter, int)
AIPLintV3 accepts an OpenAPI v2 document and will call the individual AIP rules on the document.
func (*Linter) Descriptor
deprecated
func (*Linter) GetMessages ¶
func (*Linter) ProtoMessage ¶
func (*Linter) ProtoMessage()
func (*Linter) ProtoReflect ¶
func (x *Linter) ProtoReflect() protoreflect.Message
type Message ¶
type Message struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Suggestion string `protobuf:"bytes,3,opt,name=suggestion,proto3" json:"suggestion,omitempty"` Keys []string `protobuf:"bytes,4,rep,name=keys,proto3" json:"keys,omitempty"` Line int32 `protobuf:"varint,5,opt,name=line,proto3" json:"line,omitempty"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) GetMessage ¶
func (*Message) GetSuggestion ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type WarningResult ¶
type WarningResult struct { OperationID []WMessage `json:"operation-ids"` Operations []WMessage `json:"operation"` Refs []WMessage `json:"refs"` Schemas []EMessage `json:"schema-ibm"` PathsIBM []EMessage `json:"paths-ibm"` WalkerIBM []EMessage `json:"walker-ibm"` CircularIBM []WMessage `json:"circular-references-ibm"` Responses []EMessage `json:"responses"` ParametersIBM []EMessage `json:"parameters-ibm"` }