openapi

package
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllOperationsJSONPath

func GetAllOperationsJSONPath() string

GetAllOperationsJSONPath wil return a string that can be used as a query for extracting all OpenAPI operations.

func GetComponentsFromRoot

func GetComponentsFromRoot(nodes []*yaml.Node) []*yaml.Node

GetComponentsFromRoot will extract all operation (paths nodes) from the root of an OpenAPI document.

func GetOperationsFromRoot

func GetOperationsFromRoot(nodes []*yaml.Node) []*yaml.Node

GetOperationsFromRoot will extract all operation (paths nodes) from the root of an OpenAPI document.

func GetTagsFromRoot

func GetTagsFromRoot(nodes []*yaml.Node) []*yaml.Node

GetTagsFromRoot will extract all tag nodes from the root of an OpenAPI document.

Types

type APIServers

type APIServers struct{}

APIServers checks that the servers property of the document has been set

func (APIServers) GetCategory added in v0.10.0

func (as APIServers) GetCategory() string

GetCategory returns the category of the APIServers rule.

func (APIServers) GetSchema

func (as APIServers) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the APIServers rule.

func (APIServers) RunRule

func (as APIServers) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the APIServers rule, based on supplied context and a supplied []*yaml.Node slice.

type AmbiguousPaths added in v0.0.12

type AmbiguousPaths struct {
}

AmbiguousPaths will determine if paths can be confused by a compiler.

func (AmbiguousPaths) GetCategory added in v0.10.0

func (ap AmbiguousPaths) GetCategory() string

GetCategory returns the category of the AmbiguousPaths rule.

func (AmbiguousPaths) GetSchema added in v0.0.12

func (ap AmbiguousPaths) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the AmbiguousPaths rule.

func (AmbiguousPaths) RunRule added in v0.0.12

func (ap AmbiguousPaths) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the AmbiguousPaths rule, based on supplied context and a supplied []*yaml.Node slice.

type ComponentDescription

type ComponentDescription struct {
}

ComponentDescription will check through all components and determine if they are correctly described

func (ComponentDescription) GetCategory added in v0.10.0

func (cd ComponentDescription) GetCategory() string

GetCategory returns the category of the ComponentDescription rule.

func (ComponentDescription) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the ComponentDescription rule.

func (ComponentDescription) RunRule

func (cd ComponentDescription) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the ComponentDescription rule, based on supplied context and a supplied []*yaml.Node slice.

type DescriptionDuplication

type DescriptionDuplication struct {
}

DescriptionDuplication will check if a description has been duplicated (copy/paste)

func (DescriptionDuplication) GetCategory added in v0.10.0

func (dd DescriptionDuplication) GetCategory() string

GetCategory returns the category of the DescriptionDuplication rule.

func (DescriptionDuplication) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the DescriptionDuplication rule.

func (DescriptionDuplication) RunRule

func (dd DescriptionDuplication) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the DescriptionDuplication rule, based on supplied context and a supplied []*yaml.Node slice.

type DuplicatedEnum

type DuplicatedEnum struct {
}

DuplicatedEnum will check enum values match the types provided

func (DuplicatedEnum) GetCategory added in v0.10.0

func (de DuplicatedEnum) GetCategory() string

GetCategory returns the category of the DuplicatedEnum rule.

func (DuplicatedEnum) GetSchema

func (de DuplicatedEnum) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the DuplicatedEnum rule.

func (DuplicatedEnum) RunRule

func (de DuplicatedEnum) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the DuplicatedEnum rule, based on supplied context and a supplied []*yaml.Node slice.

type ExamplesExternalCheck added in v0.7.0

type ExamplesExternalCheck struct {
}

ExamplesExternalCheck checks Example objects don't use both `externalValue` and `value`.

func (ExamplesExternalCheck) GetCategory added in v0.10.0

func (eec ExamplesExternalCheck) GetCategory() string

GetCategory returns the category of the ComponentDescription rule.

func (ExamplesExternalCheck) GetSchema added in v0.7.0

GetSchema returns a model.RuleFunctionSchema defining the schema of the ComponentDescription rule.

func (ExamplesExternalCheck) RunRule added in v0.7.0

func (eec ExamplesExternalCheck) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the ComponentDescription rule, based on supplied context and a supplied []*yaml.Node slice.

type ExamplesMissing added in v0.7.0

type ExamplesMissing struct {
}

ExamplesMissing will check anything that can have an example, has one.

func (ExamplesMissing) GetCategory added in v0.10.0

func (em ExamplesMissing) GetCategory() string

GetCategory returns the category of the ExamplesMissing rule.

func (ExamplesMissing) GetSchema added in v0.7.0

func (em ExamplesMissing) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the ComponentDescription rule.

func (ExamplesMissing) RunRule added in v0.7.0

func (em ExamplesMissing) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the ComponentDescription rule, based on supplied context and a supplied []*yaml.Node slice.

type ExamplesSchema added in v0.7.0

type ExamplesSchema struct {
}

ExamplesSchema will check anything that has an example, has a schema and it's valid.

func (ExamplesSchema) GetCategory added in v0.10.0

func (es ExamplesSchema) GetCategory() string

GetCategory returns the category of the ExamplesMissing rule.

func (ExamplesSchema) GetSchema added in v0.7.0

func (es ExamplesSchema) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the ComponentDescription rule.

func (ExamplesSchema) RunRule added in v0.7.0

func (es ExamplesSchema) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the ComponentDescription rule, based on supplied context and a supplied []*yaml.Node slice.

type FormDataConsumeCheck

type FormDataConsumeCheck struct {
}

FormDataConsumeCheck will check enum values match the types provided

func (FormDataConsumeCheck) GetCategory added in v0.10.0

func (fd FormDataConsumeCheck) GetCategory() string

GetCategory returns the category of the FormDataConsumeCheck rule.

func (FormDataConsumeCheck) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the FormDataConsumeCheck rule.

func (FormDataConsumeCheck) RunRule

func (fd FormDataConsumeCheck) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the FormDataConsumeCheck rule, based on supplied context and a supplied []*yaml.Node slice.

type InfoContact added in v0.11.0

type InfoContact struct {
}

InfoContact will check that the info object has a contact object.

func (InfoContact) GetCategory added in v0.11.0

func (id InfoContact) GetCategory() string

GetCategory returns the category of the InfoContact rule.

func (InfoContact) GetSchema added in v0.11.0

func (id InfoContact) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the InfoContact rule.

func (InfoContact) RunRule added in v0.11.0

func (id InfoContact) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the InfoContact rule, based on supplied context and a supplied []*yaml.Node slice.

type InfoContactProperties added in v0.11.0

type InfoContactProperties struct {
}

InfoContactProperties will check that the info object has a contact object.

func (InfoContactProperties) GetCategory added in v0.11.0

func (id InfoContactProperties) GetCategory() string

GetCategory returns the category of the InfoContactProperties rule.

func (InfoContactProperties) GetSchema added in v0.11.0

GetSchema returns a model.RuleFunctionSchema defining the schema of the InfoContactProperties rule.

func (InfoContactProperties) RunRule added in v0.11.0

func (id InfoContactProperties) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the InfoContactProperties rule, based on supplied context and a supplied []*yaml.Node slice.

type InfoDescription added in v0.11.0

type InfoDescription struct {
}

InfoDescription will check that the info section has a description.

func (InfoDescription) GetCategory added in v0.11.0

func (id InfoDescription) GetCategory() string

GetCategory returns the category of the InfoDescription rule.

func (InfoDescription) GetSchema added in v0.11.0

func (id InfoDescription) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the InfoDescription rule.

func (InfoDescription) RunRule added in v0.11.0

func (id InfoDescription) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the InfoDescription rule, based on supplied context and a supplied []*yaml.Node slice.

type InfoLicense added in v0.11.0

type InfoLicense struct {
}

InfoLicense will check that the info object has a contact object.

func (InfoLicense) GetCategory added in v0.11.0

func (id InfoLicense) GetCategory() string

GetCategory returns the category of the InfoLicense rule.

func (InfoLicense) GetSchema added in v0.11.0

func (id InfoLicense) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the InfoLicense rule.

func (InfoLicense) RunRule added in v0.11.0

func (id InfoLicense) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the InfoLicense rule, based on supplied context and a supplied []*yaml.Node slice.

type InfoLicenseURL added in v0.11.0

type InfoLicenseURL struct {
}

InfoLicenseURL will check that the info object has a contact object.

func (InfoLicenseURL) GetCategory added in v0.11.0

func (id InfoLicenseURL) GetCategory() string

GetCategory returns the category of the InfoLicenseURL rule.

func (InfoLicenseURL) GetSchema added in v0.11.0

func (id InfoLicenseURL) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the InfoLicenseURL rule.

func (InfoLicenseURL) RunRule added in v0.11.0

func (id InfoLicenseURL) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the InfoLicenseURL rule, based on supplied context and a supplied []*yaml.Node slice.

type NoEvalInDescriptions

type NoEvalInDescriptions struct {
}

NoEvalInDescriptions will check if a description contains potentially malicious javascript

func (NoEvalInDescriptions) GetCategory added in v0.10.0

func (ne NoEvalInDescriptions) GetCategory() string

GetCategory returns the category of the NoEvalInDescriptions rule.

func (NoEvalInDescriptions) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the NoEvalInDescriptions rule.

func (NoEvalInDescriptions) RunRule

func (ne NoEvalInDescriptions) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the NoEvalInDescriptions rule, based on supplied context and a supplied []*yaml.Node slice.

type NoRefSiblings

type NoRefSiblings struct {
}

NoRefSiblings will check for anything placed next to a $ref (like a description) and will throw some shade if something is found. This rule is there to prevent us from adding useless properties to a $ref child.

func (NoRefSiblings) GetCategory added in v0.10.0

func (nrs NoRefSiblings) GetCategory() string

GetCategory returns the category of the NoRefSiblings rule.

func (NoRefSiblings) GetSchema

func (nrs NoRefSiblings) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the NoRefSiblings rule.

func (NoRefSiblings) RunRule

func (nrs NoRefSiblings) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the NoRefSiblings rule, based on supplied context and a supplied []*yaml.Node slice.

type OAS2Discriminator

type OAS2Discriminator struct{}

OAS2Discriminator checks swagger schemas are using discriminators properly.

func (OAS2Discriminator) GetCategory added in v0.10.0

func (od OAS2Discriminator) GetCategory() string

GetCategory returns the category of the OperationSingleTag rule.

func (OAS2Discriminator) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the OperationSingleTag rule.

func (OAS2Discriminator) RunRule

func (od OAS2Discriminator) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the OperationSingleTag rule, based on supplied context and a supplied []*yaml.Node slice.

type OAS2OperationSecurityDefined

type OAS2OperationSecurityDefined struct {
}

OAS2OperationSecurityDefined will check to make sure operation security has been defined correctly for swagger docs.

func (OAS2OperationSecurityDefined) GetCategory added in v0.10.0

func (sd OAS2OperationSecurityDefined) GetCategory() string

GetCategory returns the category of the UniqueOperationId rule.

func (OAS2OperationSecurityDefined) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the UniqueOperationId rule.

func (OAS2OperationSecurityDefined) RunRule

func (sd OAS2OperationSecurityDefined) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the OAS2OperationSecurityDefined rule, based on supplied context and a supplied []*yaml.Node slice.

type OASSchema

type OASSchema struct {
}

OASSchema will check that the document is a valid OpenAPI schema.

func (OASSchema) GetCategory added in v0.10.0

func (os OASSchema) GetCategory() string

GetCategory returns the category of the OASSchema rule.

func (OASSchema) GetSchema

func (os OASSchema) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the OASSchema rule.

func (OASSchema) RunRule

func (os OASSchema) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the OASSchema rule, based on supplied context and a supplied []*yaml.Node slice.

type Operation4xResponse added in v0.0.13

type Operation4xResponse struct {
}

Operation4xResponse is a rule that checks if an operation returns a 4xx (user error) code.

func (Operation4xResponse) GetCategory added in v0.10.0

func (or Operation4xResponse) GetCategory() string

GetCategory returns the category of the SuccessResponse rule.

func (Operation4xResponse) GetSchema added in v0.0.13

GetSchema returns a model.RuleFunctionSchema defining the schema of the SuccessResponse rule.

func (Operation4xResponse) RunRule added in v0.0.13

func (or Operation4xResponse) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the Operation4xResponse rule, based on supplied context and a supplied []*yaml.Node slice.

type OperationDescription

type OperationDescription struct {
}

OperationDescription will check if an operation has a description, and if the description is useful

func (OperationDescription) GetCategory added in v0.10.0

func (od OperationDescription) GetCategory() string

GetCategory returns the category of the OperationDescription rule.

func (OperationDescription) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the OperationDescription rule.

func (OperationDescription) RunRule

func (od OperationDescription) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the OperationDescription rule, based on supplied context and a supplied []*yaml.Node slice.

type OperationId

type OperationId struct {
}

OperationId is a rule that will check if each operation provides an operationId

func (OperationId) GetCategory added in v0.10.0

func (oId OperationId) GetCategory() string

GetCategory returns the category of the OperationId rule.

func (OperationId) GetSchema

func (oId OperationId) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the OperationId rule.

func (OperationId) RunRule

func (oId OperationId) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the OperationId rule, based on supplied context and a supplied []*yaml.Node slice.

type OperationParameters

type OperationParameters struct {
}

OperationParameters is a rule that checks for valid parameters and parameters combinations

func (OperationParameters) GetCategory added in v0.10.0

func (op OperationParameters) GetCategory() string

GetCategory returns the category of the OperationParameters rule.

func (OperationParameters) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the OperationParameters rule.

func (OperationParameters) RunRule

func (op OperationParameters) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the OperationParameters rule, based on supplied context and a supplied []*yaml.Node slice.

type OperationSecurityDefined

type OperationSecurityDefined struct {
}

OperationSecurityDefined is a rule that checks operation security against defined global schemes.

func (OperationSecurityDefined) GetCategory added in v0.10.0

func (osd OperationSecurityDefined) GetCategory() string

GetCategory returns the category of the OperationSecurityDefined rule.

func (OperationSecurityDefined) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the OperationSecurityDefined rule.

func (OperationSecurityDefined) RunRule

func (osd OperationSecurityDefined) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the OperationSecurityDefined rule, based on supplied context and a supplied []*yaml.Node slice.

type OperationSingleTag

type OperationSingleTag struct {
}

OperationSingleTag checks that each operation only has a single tag.

func (OperationSingleTag) GetCategory added in v0.10.0

func (ost OperationSingleTag) GetCategory() string

GetCategory returns the category of the OperationSingleTag rule.

func (OperationSingleTag) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the OperationSingleTag rule.

func (OperationSingleTag) RunRule

func (ost OperationSingleTag) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the OperationSingleTag rule, based on supplied context and a supplied []*yaml.Node slice.

type OperationTags

type OperationTags struct{}

OperationTags is a rule that checks operations are using tags and they are not empty.

func (OperationTags) GetCategory added in v0.10.0

func (ot OperationTags) GetCategory() string

GetCategory returns the category of the TagDefined rule.

func (OperationTags) GetSchema

func (ot OperationTags) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the TagDefined rule.

func (OperationTags) RunRule

func (ot OperationTags) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the OperationTags rule, based on supplied context and a supplied []*yaml.Node slice.

type ParameterDescription

type ParameterDescription struct {
}

ParameterDescription will check swagger spec parameters for a description. ($.parameters)

func (ParameterDescription) GetCategory added in v0.10.0

func (pd ParameterDescription) GetCategory() string

GetCategory returns the category of the ParameterDescription rule.

func (ParameterDescription) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the ParameterDescription rule.

func (ParameterDescription) RunRule

func (pd ParameterDescription) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the ParameterDescription rule, based on supplied context and a supplied []*yaml.Node slice.

type PathParameters

type PathParameters struct {
}

PathParameters is a rule that checks path level and operation level parameters for correct paths. The rule is one of the more complex ones, so here is a little detail as to what is happening. -- normalize paths to replace vars with % -- check for duplicate paths based on param placement -- check for duplicate param names in paths -- check for any unknown params (no name) -- check if required is set, that it's set to true only. -- check no duplicate params -- operation paths only -- all params in path must be defined -- all defined path params must be in path.

func (PathParameters) GetCategory added in v0.10.0

func (pp PathParameters) GetCategory() string

GetCategory returns the category of the PathParameters rule.

func (PathParameters) GetSchema

func (pp PathParameters) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the PathParameters rule.

func (PathParameters) RunRule

func (pp PathParameters) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the PathParameters rule, based on supplied context and a supplied []*yaml.Node slice.

type PathsKebabCase added in v0.0.13

type PathsKebabCase struct {
}

PathsKebabCase Checks to ensure each segment of a path is using kebab case.

func (PathsKebabCase) GetCategory added in v0.10.0

func (vp PathsKebabCase) GetCategory() string

GetCategory returns the category of the VerbsInPath rule.

func (PathsKebabCase) GetSchema added in v0.0.13

func (vp PathsKebabCase) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the VerbsInPath rule.

func (PathsKebabCase) RunRule added in v0.0.13

func (vp PathsKebabCase) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the PathsKebabCase rule, based on supplied context and a supplied []*yaml.Node slice.

type PolymorphicAnyOf

type PolymorphicAnyOf struct {
}

PolymorphicAnyOf checks that there is no polymorphism used, in particular 'anyOf'

func (PolymorphicAnyOf) GetCategory added in v0.10.0

func (pm PolymorphicAnyOf) GetCategory() string

GetCategory returns the category of the PolymorphicAnyOf rule.

func (PolymorphicAnyOf) GetSchema

func (pm PolymorphicAnyOf) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the PolymorphicAnyOf rule.

func (PolymorphicAnyOf) RunRule

func (pm PolymorphicAnyOf) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the PolymorphicAnyOf rule, based on supplied context and a supplied []*yaml.Node slice.

type PolymorphicOneOf

type PolymorphicOneOf struct {
}

PolymorphicOneOf checks that there is no polymorphism used, in particular 'anyOf'

func (PolymorphicOneOf) GetCategory added in v0.10.0

func (pm PolymorphicOneOf) GetCategory() string

GetCategory returns the category of the PolymorphicOneOf rule.

func (PolymorphicOneOf) GetSchema

func (pm PolymorphicOneOf) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the PolymorphicOneOf rule.

func (PolymorphicOneOf) RunRule

func (pm PolymorphicOneOf) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the PolymorphicOneOf rule, based on supplied context and a supplied []*yaml.Node slice.

type PostResponseSuccess

type PostResponseSuccess struct {
}

PostResponseSuccess is a rule that will check if a post operations contain a successful response code or not.

func (PostResponseSuccess) GetCategory added in v0.10.0

func (prs PostResponseSuccess) GetCategory() string

GetCategory returns the category of the PostResponseSuccess rule.

func (PostResponseSuccess) GetSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the PostResponseSuccess rule.

func (PostResponseSuccess) RunRule

func (prs PostResponseSuccess) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the PostResponseSuccess rule, based on supplied context and a supplied []*yaml.Node slice.

type SchemaTypeCheck added in v0.8.0

type SchemaTypeCheck struct {
}

SchemaTypeCheck will determine if document schemas contain the correct type

func (SchemaTypeCheck) GetCategory added in v0.10.0

func (st SchemaTypeCheck) GetCategory() string

GetCategory returns the category of the DuplicatedEnum rule.

func (SchemaTypeCheck) GetSchema added in v0.8.0

func (st SchemaTypeCheck) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the DuplicatedEnum rule.

func (SchemaTypeCheck) RunRule added in v0.8.0

func (st SchemaTypeCheck) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the DuplicatedEnum rule, based on supplied context and a supplied []*yaml.Node slice.

type SuccessResponse

type SuccessResponse struct {
}

SuccessResponse is a rule that checks if an operation returns a code >= 200 and <= 400

func (SuccessResponse) GetCategory added in v0.10.0

func (sr SuccessResponse) GetCategory() string

GetCategory returns the category of the SuccessResponse rule.

func (SuccessResponse) GetSchema

func (sr SuccessResponse) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the SuccessResponse rule.

func (SuccessResponse) RunRule

func (sr SuccessResponse) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the SuccessResponse rule, based on supplied context and a supplied []*yaml.Node slice.

type TagDefined

type TagDefined struct{}

TagDefined is a rule that checks if an operation uses a tag, it's also defined in the global tag definitions.

func (TagDefined) GetCategory added in v0.10.0

func (td TagDefined) GetCategory() string

GetCategory returns the category of the TagDefined rule.

func (TagDefined) GetSchema

func (td TagDefined) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the TagDefined rule.

func (TagDefined) RunRule

func (td TagDefined) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the TagDefined rule, based on supplied context and a supplied []*yaml.Node slice.

type TagDescription added in v0.11.0

type TagDescription struct {
}

TagDescription will check that all tags have a description.

func (TagDescription) GetCategory added in v0.11.0

func (td TagDescription) GetCategory() string

GetCategory returns the category of the TagDescription rule.

func (TagDescription) GetSchema added in v0.11.0

func (td TagDescription) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the TagDescription rule.

func (TagDescription) RunRule added in v0.11.0

func (td TagDescription) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the TagDescription rule, based on supplied context and a supplied []*yaml.Node slice.

type TypedEnum

type TypedEnum struct{}

TypedEnum will check enum values match the types provided

func (TypedEnum) GetCategory added in v0.10.0

func (te TypedEnum) GetCategory() string

GetCategory returns the category of the TypedEnum rule.

func (TypedEnum) GetSchema

func (te TypedEnum) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the TypedEnum rule.

func (TypedEnum) RunRule

func (te TypedEnum) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the TypedEnum rule, based on supplied context and a supplied []*yaml.Node slice.

type UniqueOperationId

type UniqueOperationId struct {
}

UniqueOperationId is a rule that will check if each operation provides an operationId, as well as making sure that all the operationId's in the spec are unique.

func (UniqueOperationId) GetCategory added in v0.10.0

func (oId UniqueOperationId) GetCategory() string

GetCategory returns the category of the UniqueOperationId rule.

func (UniqueOperationId) GetSchema

func (oId UniqueOperationId) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the UniqueOperationId rule.

func (UniqueOperationId) RunRule

func (oId UniqueOperationId) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the UniqueOperationId rule, based on supplied context and a supplied []*yaml.Node slice.

type UnusedComponent

type UnusedComponent struct {
}

UnusedComponent will check if a component or definition has been created, but it's not used anywhere by anything.

func (UnusedComponent) GetCategory added in v0.10.0

func (uc UnusedComponent) GetCategory() string

GetCategory returns the category of the UnusedComponent rule.

func (UnusedComponent) GetSchema

func (uc UnusedComponent) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the UnusedComponent rule.

func (UnusedComponent) RunRule

func (uc UnusedComponent) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the UnusedComponent rule, based on supplied context and a supplied []*yaml.Node slice.

type VerbsInPaths added in v0.0.13

type VerbsInPaths struct {
}

VerbsInPaths Checks to make sure that no HTTP verbs have been used

func (VerbsInPaths) GetCategory added in v0.10.0

func (vp VerbsInPaths) GetCategory() string

GetCategory returns the category of the VerbsInPath rule.

func (VerbsInPaths) GetSchema added in v0.0.13

func (vp VerbsInPaths) GetSchema() model.RuleFunctionSchema

GetSchema returns a model.RuleFunctionSchema defining the schema of the VerbsInPath rule.

func (VerbsInPaths) RunRule added in v0.0.13

func (vp VerbsInPaths) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult

RunRule will execute the VerbsInPath rule, based on supplied context and a supplied []*yaml.Node slice.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL