Documentation
¶
Index ¶
- func GetAllOperationsJSONPath() string
- func GetComponentsFromRoot(nodes []*yaml.Node) []*yaml.Node
- func GetOperationsFromRoot(nodes []*yaml.Node) []*yaml.Node
- func GetTagsFromRoot(nodes []*yaml.Node) []*yaml.Node
- type APIServers
- type AmbiguousPaths
- type CamelCaseProperties
- type ComponentDescription
- type DescriptionDuplication
- type DuplicatePaths
- type DuplicatedEnum
- type ExamplesExternalCheck
- type ExamplesMissing
- type ExamplesSchema
- type FormDataConsumeCheck
- type InfoContact
- type InfoContactProperties
- type InfoDescription
- type InfoLicense
- type InfoLicenseURL
- type InfoLicenseURLSPDX
- type MigrateZallyIgnore
- type MissingType
- type NoEvalInDescriptions
- type NoRefSiblings
- type NoRequestBody
- type NullableEnum
- type OAS2Discriminator
- type OAS2OperationSecurityDefined
- type OASNoRefSiblings
- type OASSchema
- type Operation4xResponse
- type OperationDescription
- type OperationId
- type OperationParameters
- type OperationSecurityDefined
- type OperationSingleTag
- type OperationTags
- type ParameterDescription
- type PathItemReferences
- type PathParameters
- type PathsKebabCase
- type PolymorphicAnyOf
- type PolymorphicOneOf
- type PostResponseSuccess
- type SchemaTypeCheck
- type SuccessResponse
- type TagDefined
- type TagDescription
- type TypedEnum
- type UniqueOperationId
- type UnnecessaryCombinator
- type UnusedComponent
- type VerbsInPaths
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 ¶
GetComponentsFromRoot will extract all operation (paths nodes) from the root of an OpenAPI document.
func GetOperationsFromRoot ¶
GetOperationsFromRoot will extract all operation (paths 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 CamelCaseProperties ¶ added in v0.18.0
type CamelCaseProperties struct {
}
CamelCaseProperties checks that all schema property names are in camelCase format.
func (CamelCaseProperties) GetCategory ¶ added in v0.18.0
func (ccp CamelCaseProperties) GetCategory() string
GetCategory returns the category of the CamelCaseProperties rule.
func (CamelCaseProperties) GetSchema ¶ added in v0.18.0
func (ccp CamelCaseProperties) GetSchema() model.RuleFunctionSchema
GetSchema returns a model.RuleFunctionSchema defining the schema of the CamelCaseProperties rule.
func (CamelCaseProperties) RunRule ¶ added in v0.18.0
func (ccp CamelCaseProperties) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult
RunRule will execute the CamelCaseProperties 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 ¶
func (cd ComponentDescription) GetSchema() model.RuleFunctionSchema
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 ¶
func (dd DescriptionDuplication) GetSchema() model.RuleFunctionSchema
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 DuplicatePaths ¶ added in v0.18.0
type DuplicatePaths struct {
}
DuplicatePaths checks for duplicate path definitions in the OpenAPI spec. This catches the case where YAML allows duplicate keys but only keeps the last one, which can lead to unintentional loss of path definitions.
func (DuplicatePaths) GetCategory ¶ added in v0.18.0
func (dp DuplicatePaths) GetCategory() string
GetCategory returns the category of the DuplicatePaths rule.
func (DuplicatePaths) GetSchema ¶ added in v0.18.0
func (dp DuplicatePaths) GetSchema() model.RuleFunctionSchema
GetSchema returns a model.RuleFunctionSchema defining the schema of the DuplicatePaths rule.
func (DuplicatePaths) RunRule ¶ added in v0.18.0
func (dp DuplicatePaths) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult
RunRule will execute the DuplicatePaths 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
func (eec ExamplesExternalCheck) GetSchema() model.RuleFunctionSchema
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, ruleContext 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 ¶
func (fd FormDataConsumeCheck) GetSchema() model.RuleFunctionSchema
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
func (id InfoContactProperties) GetSchema() model.RuleFunctionSchema
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 license object contains a URL.
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 InfoLicenseURLSPDX ¶ added in v0.13.0
type InfoLicenseURLSPDX struct {
}
InfoLicenseURLSPDX will check that the license object contains a URL OR an SPDX identifier, not both.
func (InfoLicenseURLSPDX) GetCategory ¶ added in v0.13.0
func (id InfoLicenseURLSPDX) GetCategory() string
GetCategory returns the category of the InfoLicenseURL rule.
func (InfoLicenseURLSPDX) GetSchema ¶ added in v0.13.0
func (id InfoLicenseURLSPDX) GetSchema() model.RuleFunctionSchema
GetSchema returns a model.RuleFunctionSchema defining the schema of the InfoLicenseURL rule.
func (InfoLicenseURLSPDX) RunRule ¶ added in v0.13.0
func (id InfoLicenseURLSPDX) 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 MigrateZallyIgnore ¶ added in v0.19.2
type MigrateZallyIgnore struct{}
MigrateZallyIgnore will check for x-zally-ignore keys and suggest migration to x-lint-ignore
func (MigrateZallyIgnore) GetCategory ¶ added in v0.19.2
func (m MigrateZallyIgnore) GetCategory() string
GetCategory returns the category of the MigrateZallyIngore rule.
func (MigrateZallyIgnore) GetSchema ¶ added in v0.19.2
func (m MigrateZallyIgnore) GetSchema() model.RuleFunctionSchema
GetSchema returns a model.RuleFunctionSchema defining the schema of the MigrateZallyIngore rule.
func (MigrateZallyIgnore) RunRule ¶ added in v0.19.2
func (m MigrateZallyIgnore) RunRule( nodes []*yaml.Node, context model.RuleFunctionContext, ) []model.RuleFunctionResult
RunRule will execute the MigrateZallyIngore rule, based on supplied context and a supplied []*yaml.Node slice.
type MissingType ¶ added in v0.17.11
type MissingType struct {
}
MissingType will check that all schemas and their properties have a type defined
func (MissingType) GetCategory ¶ added in v0.17.11
func (mt MissingType) GetCategory() string
GetCategory returns the category of the MissingType rule.
func (MissingType) GetSchema ¶ added in v0.17.11
func (mt MissingType) GetSchema() model.RuleFunctionSchema
GetSchema returns a model.RuleFunctionSchema defining the schema of the MissingType rule.
func (MissingType) RunRule ¶ added in v0.17.11
func (mt MissingType) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult
RunRule will execute the MissingType 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 ¶
func (ne NoEvalInDescriptions) GetSchema() model.RuleFunctionSchema
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 NoRequestBody ¶ added in v0.15.0
type NoRequestBody struct {
}
NoRequestBody is a rule that checks operations are using tags and they are not empty.
func (NoRequestBody) GetCategory ¶ added in v0.15.0
func (r NoRequestBody) GetCategory() string
GetCategory returns the category of the TagDefined rule.
func (NoRequestBody) GetSchema ¶ added in v0.15.0
func (r NoRequestBody) GetSchema() model.RuleFunctionSchema
GetSchema returns a model.RuleFunctionSchema defining the schema of the NoRequestBody rule.
func (NoRequestBody) RunRule ¶ added in v0.15.0
func (r NoRequestBody) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult
RunRule will execute the NoRequestBody rule, based on supplied context and a supplied []*yaml.Node slice.
type NullableEnum ¶ added in v0.20.2
type NullableEnum struct{}
NullableEnum checks that nullable enums explicitly contain a null value in their enum array. This validates both OpenAPI 3.0 (nullable: true) and OpenAPI 3.1 (type: [string, "null"]) patterns.
func (NullableEnum) GetCategory ¶ added in v0.20.2
func (ne NullableEnum) GetCategory() string
func (NullableEnum) GetSchema ¶ added in v0.20.2
func (ne NullableEnum) GetSchema() model.RuleFunctionSchema
func (NullableEnum) RunRule ¶ added in v0.20.2
func (ne NullableEnum) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult
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 ¶
func (od OAS2Discriminator) GetSchema() model.RuleFunctionSchema
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 ¶
func (sd OAS2OperationSecurityDefined) GetSchema() model.RuleFunctionSchema
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 OASNoRefSiblings ¶ added in v0.14.3
type OASNoRefSiblings struct {
}
OASNoRefSiblings validates that no properties other than `description` and `summary` are added alongside a `$ref`. This rule helps ensure that only essential properties are attached to `$ref` nodes, preventing unnecessary and unused additions.
func (OASNoRefSiblings) GetCategory ¶ added in v0.14.3
func (nrs OASNoRefSiblings) GetCategory() string
GetCategory returns the category of the OASNoRefSiblings rule.
func (OASNoRefSiblings) GetSchema ¶ added in v0.14.3
func (nrs OASNoRefSiblings) GetSchema() model.RuleFunctionSchema
GetSchema returns a model.RuleFunctionSchema defining the schema of the OASNoRefSiblings rule.
func (OASNoRefSiblings) RunRule ¶ added in v0.14.3
func (nrs OASNoRefSiblings) RunRule(nodes []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult
RunRule will execute the OASNoRefSiblings 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
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
func (or Operation4xResponse) GetSchema() model.RuleFunctionSchema
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 ¶
func (od OperationDescription) GetSchema() model.RuleFunctionSchema
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 ¶
func (op OperationParameters) GetSchema() model.RuleFunctionSchema
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 ¶
func (osd OperationSecurityDefined) GetSchema() model.RuleFunctionSchema
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 ¶
func (ost OperationSingleTag) GetSchema() model.RuleFunctionSchema
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 ¶
func (pd ParameterDescription) GetSchema() model.RuleFunctionSchema
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 PathItemReferences ¶ added in v0.15.0
type PathItemReferences struct {
}
PathItemReferences will check that path items are not using references, as they are not allowed although many folks do it. This is a common mistake, this will help catch it.
func (PathItemReferences) GetCategory ¶ added in v0.15.0
func (id PathItemReferences) GetCategory() string
GetCategory returns the category of the InfoContact rule.
func (PathItemReferences) GetSchema ¶ added in v0.15.0
func (id PathItemReferences) GetSchema() model.RuleFunctionSchema
GetSchema returns a model.RuleFunctionSchema defining the schema of the PathItemReferences rule.
func (PathItemReferences) RunRule ¶ added in v0.15.0
func (id PathItemReferences) 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 PathParameters ¶
type PathParameters struct {
// contains filtered or unexported fields
}
PathParameters is a rule that checks path level and operation level parameters for correct paths. this rule has been refactored to use the doctor model. The logic is now much simpler, but does not work against swagger
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 ¶
func (prs PostResponseSuccess) GetSchema() model.RuleFunctionSchema
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
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 UnnecessaryCombinator ¶ added in v0.18.0
type UnnecessaryCombinator struct {
}
UnnecessaryCombinator checks for schema combinators (allOf, anyOf, oneOf) that have only a single item, which makes them unnecessary and should be replaced with the single item directly.
func (UnnecessaryCombinator) GetCategory ¶ added in v0.18.0
func (uc UnnecessaryCombinator) GetCategory() string
GetCategory returns the category of the UnnecessaryCombinator rule.
func (UnnecessaryCombinator) GetSchema ¶ added in v0.18.0
func (uc UnnecessaryCombinator) GetSchema() model.RuleFunctionSchema
GetSchema returns a model.RuleFunctionSchema defining the schema of the UnnecessaryCombinator rule.
func (UnnecessaryCombinator) RunRule ¶ added in v0.18.0
func (uc UnnecessaryCombinator) RunRule(_ []*yaml.Node, context model.RuleFunctionContext) []model.RuleFunctionResult
RunRule will execute the UnnecessaryCombinator 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.
Source Files
¶
- camel_case_properties.go
- component_descriptions.go
- description_duplication.go
- duplicate_paths.go
- duplicated_enum_entry.go
- examples_external_val.go
- examples_missing.go
- examples_schema.go
- formdata_consume_check.go
- info_contact.go
- info_contact_properties.go
- info_description.go
- info_license.go
- info_license_url.go
- info_license_urlspdx.go
- migrate_zally_ignore.go
- missing_type.go
- no_ambiguous_paths.go
- no_eval_descriptions.go
- no_http_verbs_in_path.go
- no_ref_siblings.go
- no_request_body.go
- nullable_enum.go
- oas2_discriminator.go
- oas2_operation_security_defined.go
- oas_no_ref_siblings.go
- oas_schema.go
- openapi_api_servers.go
- openapi_utils.go
- operation_4x_response.go
- operation_descriptions.go
- operation_id.go
- operation_parameters.go
- operation_security_defined.go
- operation_single_tag.go
- operation_tag_defined.go
- operation_tags.go
- parameter_description.go
- path_item_ref.go
- path_parameters.go
- paths_kebab_case.go
- polymorphic_anyOf.go
- polymorphic_oneOf.go
- post_response_success.go
- schema_type.go
- success_response.go
- tag_description.go
- typed_enum.go
- unique_operation_id.go
- unnecessary_combinator.go
- unused_component.go