Documentation
¶
Index ¶
Constants ¶
View Source
const ( OAS2 = "oas2" OAS3 = "oas3" OAS31 = "oas3_1" )
Variables ¶
View Source
var AllFormats = []string{OAS3, OAS31, OAS2}
View Source
var OAS2Format = []string{OAS2}
View Source
var OAS3AllFormat = []string{OAS3, OAS31}
View Source
var OAS3Format = []string{OAS3}
View Source
var OAS3_1Format = []string{OAS31}
View Source
var OpenAPI2SchemaData string
View Source
var OpenAPI3SchemaData string
Functions ¶
func AreValuesCorrectlyTyped ¶
AreValuesCorrectlyTyped will look through an array of unknown values and check they match against the supplied type as a string. The return value is empty if everything is OK, or it contains failures in the form of a value as a key and a message as to why it's not valid
Types ¶
type SpecInfo ¶
type SpecInfo struct {
SpecType string `json:"type"`
Version string `json:"version"`
SpecFormat string `json:"format"`
SpecFileType string `json:"fileType"`
RootNode *yaml.Node `json:"-"` // reference to the root node of the spec.
SpecBytes *[]byte `json:"bytes"` // the original bytes
SpecJSONBytes *[]byte `json:"-"` // original bytes converted to JSON
SpecJSON *map[string]interface{} `json:"-"` // standard JSON map of original bytes
Error error `json:"-"` // something go wrong?
APISchema string `json:"-"` // API Schema for supplied spec type (2 or 3)
Generated time.Time `json:"-"`
JsonParsingChannel chan bool `json:"-"`
}
SpecInfo represents information about a supplied specification.
func ExtractSpecInfo ¶
ExtractSpecInfo will look at a supplied OpenAPI specification, and return a *SpecInfo pointer, or an error if the spec cannot be parsed correctly.
func (SpecInfo) GetJSONParsingChannel ¶
GetJSONParsingChannel returns a channel that will close once async JSON parsing is completed. This is required as rules may start executing before we're even done reading in the spec to JSON.
Click to show internal directories.
Click to hide internal directories.