Documentation ¶
Index ¶
- Constants
- func PointerCondense(s string) string
- func PointerSubEscapeAll(format string, vars ...interface{}) string
- func RuleToCaseStyle(s string) string
- type Policy
- type PolicyRule
- type PolicyViolation
- type PolicyViolationLocations
- type PolicyViolationsSet
- type PolicyViolationsSets
- func NewPolicyViolationsSets() PolicyViolationsSets
- func ParametersCheck(params oas3.Parameters, jsPointerParameters string, rules Policy) PolicyViolationsSets
- func SpecCheckDataTypesFormats(spec *oas3.Swagger, ruleset Policy) PolicyViolationsSets
- func SpecCheckOperations(spec *oas3.Swagger, ruleset Policy) PolicyViolationsSets
- func SpecCheckPathItems(spec *oas3.Swagger, rules Policy) PolicyViolationsSets
- func SpecCheckSchemaObjectPropsExist(spec *oas3.Swagger) PolicyViolationsSets
- func SpecCheckSchemaPropertyEnumCaseStyle(spec *oas3.Swagger, rule string) PolicyViolationsSets
- func SpecCheckSchemas(spec *oas3.Swagger, rules Policy) PolicyViolationsSets
- func SpecCheckViolations(spec *oas3.Swagger, rules Policy) (PolicyViolationsSets, error)
- func (sets *PolicyViolationsSets) AddSimple(ruleName, location, value string)
- func (sets *PolicyViolationsSets) Count() uint
- func (sets *PolicyViolationsSets) LocationsByRule() ViolationLocationsByRuleSet
- func (sets *PolicyViolationsSets) UpsertSet(upsertSet PolicyViolationsSet) error
- func (sets *PolicyViolationsSets) UpsertSets(upsertSets PolicyViolationsSets) error
- type PolicyViolationsSetsByFile
- type Rule
- type SpecCheckViolationsFunc
- type ViolationLocationsByRuleSet
Constants ¶
View Source
const ( // Optional RuleDatatypeIntFormatIsInt32OrInt64 = "datatype-int-format-int32-int64" RuleOpDescExist = "operation-description-exist" RuleOpIdExist = "operation-operationid-exist" RuleOpIdStyleCamelCase = "operation-operationid-style-camelcase" RuleOpSummaryExist = "operation-summary-exist" RuleOpSummaryCaseFirstCapitalized = "operation-summary-first-letter-capitalized" RuleOpTagsCountOneOnly = "operation-tags-count-one" RulePathParamNameExist = "path-param-name-exist" RulePathParamStyleCamelCase = "path-param-style-camelcase" RuleSchemaPropEnumStylePascalCase = "property-enum-style-pascalcase" RuleSchemaPropDescExist = "property-description-exist" RuleSchemaObjectPropsExist = "schema-object-properties-exist" RuleTagCaseFirstCapitalized = "tag-case-first-capitalized" // Mandatory RuleOpParameterNameNonEmpty = "operation-parameter-name-non-empty" // Prefixes PrefixPathParam = "path.param." PrefixSchemaPropertyEnum = "schema.property.enum.style." RuleInternalError = "internal.error" LocationPaths = "#/paths" LocationSchemas = "#/components/schemas" )
View Source
const ( SeverityDisabled = "disabled" SeverityError = "error" SeverityHint = "hint" SeverityInformation = "information" SeverityWarning = "warning" )
Variables ¶
This section is empty.
Functions ¶
func PointerCondense ¶
func PointerSubEscapeAll ¶
func RuleToCaseStyle ¶
Types ¶
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
func NewPolicySimple ¶
func (*Policy) HasPathItemRules ¶
func (*Policy) HasRulePrefix ¶
func (*Policy) HasSchemaEnumStyleRules ¶
func (*Policy) RulesWithPrefix ¶
type PolicyRule ¶
type PolicyViolation ¶
type PolicyViolationLocations ¶
func (*PolicyViolationLocations) Finalize ¶
func (vl *PolicyViolationLocations) Finalize()
type PolicyViolationsSet ¶
type PolicyViolationsSet struct { RuleName string Violations []PolicyViolation }
func NewPolicyViolationsSet ¶
func NewPolicyViolationsSet(ruleName string) PolicyViolationsSet
func (*PolicyViolationsSet) Count ¶
func (set *PolicyViolationsSet) Count() uint
func (*PolicyViolationsSet) Locations ¶
func (set *PolicyViolationsSet) Locations() PolicyViolationLocations
type PolicyViolationsSets ¶
type PolicyViolationsSets struct {
ByRule map[string]PolicyViolationsSet
}
func NewPolicyViolationsSets ¶
func NewPolicyViolationsSets() PolicyViolationsSets
func ParametersCheck ¶
func ParametersCheck(params oas3.Parameters, jsPointerParameters string, rules Policy) PolicyViolationsSets
func SpecCheckDataTypesFormats ¶
func SpecCheckDataTypesFormats(spec *oas3.Swagger, ruleset Policy) PolicyViolationsSets
func SpecCheckOperations ¶
func SpecCheckOperations(spec *oas3.Swagger, ruleset Policy) PolicyViolationsSets
func SpecCheckPathItems ¶
func SpecCheckPathItems(spec *oas3.Swagger, rules Policy) PolicyViolationsSets
func SpecCheckSchemaObjectPropsExist ¶
func SpecCheckSchemaObjectPropsExist(spec *oas3.Swagger) PolicyViolationsSets
func SpecCheckSchemaPropertyEnumCaseStyle ¶
func SpecCheckSchemaPropertyEnumCaseStyle(spec *oas3.Swagger, rule string) PolicyViolationsSets
func SpecCheckSchemas ¶
func SpecCheckSchemas(spec *oas3.Swagger, rules Policy) PolicyViolationsSets
func SpecCheckViolations ¶
func SpecCheckViolations(spec *oas3.Swagger, rules Policy) (PolicyViolationsSets, error)
func (*PolicyViolationsSets) AddSimple ¶
func (sets *PolicyViolationsSets) AddSimple(ruleName, location, value string)
func (*PolicyViolationsSets) Count ¶
func (sets *PolicyViolationsSets) Count() uint
func (*PolicyViolationsSets) LocationsByRule ¶
func (sets *PolicyViolationsSets) LocationsByRule() ViolationLocationsByRuleSet
func (*PolicyViolationsSets) UpsertSet ¶
func (sets *PolicyViolationsSets) UpsertSet(upsertSet PolicyViolationsSet) error
func (*PolicyViolationsSets) UpsertSets ¶
func (sets *PolicyViolationsSets) UpsertSets(upsertSets PolicyViolationsSets) error
type PolicyViolationsSetsByFile ¶
type PolicyViolationsSetsByFile struct {
Sets map[string]PolicyViolationsSets
}
func NewPolicyViolationsSetsByFile ¶
func NewPolicyViolationsSetsByFile() PolicyViolationsSetsByFile
func (*PolicyViolationsSetsByFile) Count ¶
func (byFile *PolicyViolationsSetsByFile) Count() uint
func (*PolicyViolationsSetsByFile) LocationsByRule ¶
func (byFile *PolicyViolationsSetsByFile) LocationsByRule(filenameOnly, skipEmpty bool) map[string]ViolationLocationsByRuleSet
type SpecCheckViolationsFunc ¶
type SpecCheckViolationsFunc func(spec *oas3.Swagger, rules Policy) PolicyViolationsSets
type ViolationLocationsByRuleSet ¶
func (*ViolationLocationsByRuleSet) Condense ¶
func (vlrs *ViolationLocationsByRuleSet) Condense()
func (*ViolationLocationsByRuleSet) Count ¶
func (vlrs *ViolationLocationsByRuleSet) Count() uint
Source Files ¶
Click to show internal directories.
Click to hide internal directories.