checker

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package checker finds breaking-changes accoss openapi specifications.

Index

Constants

View Source
const (
	APISecurityRemovedCheckId       = "api-security-removed"
	APISecurityAddedCheckId         = "api-security-added"
	APISecurityScopeAddedId         = "api-security-scope-added"
	APISecurityScopeRemovedId       = "api-security-scope-removed"
	APIGlobalSecurityRemovedCheckId = "api-global-security-removed"
	APIGlobalSecurityAddedCheckId   = "api-global-security-added"
	APIGlobalSecurityScopeAddedId   = "api-global-security-scope-added"
	APIGlobalSecurityScopeRemovedId = "api-global-security-scope-removed"
)
View Source
const (
	STABILITY_DRAFT  = "draft"
	STABILITY_ALPHA  = "alpha"
	STABILITY_BETA   = "beta"
	STABILITY_STABLE = "stable"
)
View Source
const (
	APITagRemovedCheckId = "api-tag-removed"
	APITagAddedCheckId   = "api-tag-added"
)
View Source
const (
	APIComponentsSecurityRemovedCheckId           = "api-security-component-removed"
	APIComponentsSecurityAddedCheckId             = "api-security-component-added"
	APIComponentsSecurityComponentOauthUrlUpdated = "api-security-component-oauth-url-changed"
	APIComponentsSecurityTyepUpdated              = "api-security-component-type-changed"
	APIComponentsSecurityOauthTokenUrlUpdated     = "api-security-component-oauth-token-url-changed"
	APIComponentSecurityOauthScopeAdded           = "api-security-component-oauth-scope-added"
	APIComponentSecurityOauthScopeRemoved         = "api-security-component-oauth-scope-removed"
	APIComponentSecurityOauthScopeUpdated         = "api-security-component-oauth-scope-changed"
)
View Source
const (
	RequestBodyMediaTypeAdded   = "request-body-media-type-added"
	RequestBodyMediaTypeRemoved = "request-body-media-type-removed"
)
View Source
const (
	RequestOptionalPropertyBecameNonWriteOnlyCheckId = "request-optional-property-became-not-write-only"
	RequestOptionalPropertyBecameWriteOnlyCheckId    = "request-optional-property-became-write-only"
	RequestOptionalPropertyBecameReadOnlyCheckId     = "request-optional-property-became-read-only"
	RequestOptionalPropertyBecameNonReadOnlyCheckId  = "request-optional-property-became-not-read-only"
	RequestRequiredPropertyBecameNonWriteOnlyCheckId = "request-required-property-became-not-write-only"
	RequestRequiredPropertyBecameWriteOnlyCheckId    = "request-required-property-became-write-only"
	RequestRequiredPropertyBecameReadOnlyCheckId     = "request-required-property-became-read-only"
	RequestRequiredPropertyBecameNonReadOnlyCheckId  = "request-required-property-became-not-read-only"
)
View Source
const (
	ResponseMediaTypeUpdatedId = "response-media-type-removed"
	ResponseMediaTypeAddedId   = "response-media-type-added"
)
View Source
const (
	ResponseOptionalPropertyBecameNonWriteOnlyCheckId = "response-optional-property-became-not-write-only"
	ResponseOptionalPropertyBecameWriteOnlyCheckId    = "response-optional-property-became-write-only"
	ResponseOptionalPropertyBecameReadOnlyCheckId     = "response-optional-property-became-read-only"
	ResponseOptionalPropertyBecameNonReadOnlyCheckId  = "response-optional-property-became-not-read-only"
)
View Source
const (
	ResponsePropertyPatternAddedId   = "response-property-pattern-added"
	ResponsePropertyPatternChangedId = "response-property-pattern-changed"
	ResponsePropertyPatternRemovedId = "response-property-pattern-removed"
)
View Source
const (
	ResponsePropertyBecameOptionalCheckId        = "response-property-became-optional"
	ResponseWriteOnlyPropertyBecameOptionalCheck = "response-write-only-property-became-optional"
)
View Source
const (
	ResponsePropertyBecameRequiredCheckId        = "response-property-became-required"
	ResponseWriteOnlyPropertyBecameRequiredCheck = "response-write-only-property-became-required"
)
View Source
const (
	ResponsePropertyEnumValueAddedCheckId          = "response-property-enum-value-added"
	ResponseWriteOnlyPropertyEnumValueAddedCheckId = "response-write-only-property-enum-value-added"
)
View Source
const (
	ResponseRequiredPropertyRemovedCheckId          = "response-required-property-removed"
	ResponseRequiredWriteOnlyPropertyRemovedCheckId = "response-required-write-only-property-removed"
	ResponseRequiredPropertyAddedCheckId            = "response-required-property-added"
	ResponseRequiredWriteOnlyPropertyAddedCheckId   = "response-required-write-only-property-added"
)
View Source
const (
	ResponseRequiredPropertyBecameNonWriteOnlyCheckId = "response-required-property-became-not-write-only"
	ResponseRequiredPropertyBecameWriteOnlyCheckId    = "response-required-property-became-write-only"
	ResponseRequiredPropertyBecameReadOnlyCheckId     = "response-required-property-became-read-only"
	ResponseRequiredPropertyBecameNonReadOnlyCheckId  = "response-required-property-became-not-read-only"
)
View Source
const (
	BetaDeprecationDays   = 31
	StableDeprecationDays = 180
)

Variables

This section is empty.

Functions

func CheckAddedPropertiesDiff

func CheckAddedPropertiesDiff(schemaDiff *diff.SchemaDiff, processor func(propertyPath string, propertyName string, propertyItem *openapi3.Schema, propertyParentDiff *diff.SchemaDiff))

func CheckDeletedPropertiesDiff

func CheckDeletedPropertiesDiff(schemaDiff *diff.SchemaDiff, processor func(propertyPath string, propertyName string, propertyItem *openapi3.Schema, propertyParentDiff *diff.SchemaDiff))

func CheckModifiedPropertiesDiff

func CheckModifiedPropertiesDiff(schemaDiff *diff.SchemaDiff, processor func(propertyPath string, propertyName string, propertyItem *diff.SchemaDiff, propertyParentItem *diff.SchemaDiff))

func ColorizedValue

func ColorizedValue(arg interface{}) string

func GetOptionalChecks

func GetOptionalChecks() []string

func IsDecreased

func IsDecreased(from interface{}, to interface{}) bool

func IsDecreasedValue

func IsDecreasedValue(diff *diff.ValueDiff) bool

func IsIncreased

func IsIncreased(from interface{}, to interface{}) bool

func IsIncreasedValue

func IsIncreasedValue(diff *diff.ValueDiff) bool

func IsPipedOutput

func IsPipedOutput() bool

func LevelOverrides

func LevelOverrides(includeChecks utils.StringList) map[string]Level

Types

type ApiChange

type ApiChange struct {
	Id          string `json:"id,omitempty" yaml:"id,omitempty"`
	Text        string `json:"text,omitempty" yaml:"text,omitempty"`
	Comment     string `json:"comment,omitempty" yaml:"comment,omitempty"`
	Level       Level  `json:"level" yaml:"level"`
	Operation   string `json:"operation,omitempty" yaml:"operation,omitempty"`
	OperationId string `json:"operationId,omitempty" yaml:"operationId,omitempty"`
	Path        string `json:"path,omitempty" yaml:"path,omitempty"`
	Source      string `json:"source,omitempty" yaml:"source,omitempty"`
}

ApiChange represnts a change in the Paths Section of an OpenAPI spec

func (ApiChange) Error

func (c ApiChange) Error() string

func (ApiChange) GetComment

func (c ApiChange) GetComment() string

func (ApiChange) GetId

func (c ApiChange) GetId() string

func (ApiChange) GetLevel

func (c ApiChange) GetLevel() Level

func (ApiChange) GetOperation

func (c ApiChange) GetOperation() string

func (ApiChange) GetOperationId

func (c ApiChange) GetOperationId() string

func (ApiChange) GetPath

func (c ApiChange) GetPath() string

func (ApiChange) GetText

func (c ApiChange) GetText() string

func (ApiChange) LocalizedError

func (c ApiChange) LocalizedError(l Localizer) string

func (ApiChange) MatchIgnore

func (c ApiChange) MatchIgnore(ignorePath, ignoreLine string) bool

func (ApiChange) PrettyErrorText

func (c ApiChange) PrettyErrorText(l Localizer) string

type BCDiff

type BCDiff struct {
	diff.Diff
}

func (*BCDiff) AddModifiedOperation

func (d *BCDiff) AddModifiedOperation(path string, operation string) *diff.MethodDiff

func (*BCDiff) AddModifiedParameter

func (diffBC *BCDiff) AddModifiedParameter(path string, operation string, paramLocation string, paramName string) *diff.ParameterDiff

func (*BCDiff) AddModifiedPath

func (d *BCDiff) AddModifiedPath(path string) *diff.PathDiff

func (*BCDiff) AddRequestPropertiesDiff

func (diffBC *BCDiff) AddRequestPropertiesDiff(path string, operation string, mediaType string) *diff.SchemasDiff

type BackwardCompatibilityCheck

type BackwardCompatibilityCheck func(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

type Change

type Change interface {
	GetId() string
	GetText() string
	GetComment() string
	GetLevel() Level
	GetOperation() string
	GetOperationId() string
	GetPath() string

	MatchIgnore(ignorePath, ignoreLine string) bool
	LocalizedError(l Localizer) string
	PrettyErrorText(l Localizer) string
	Error() string
}

type Changes

type Changes []Change

func APIAddedCheck

func APIAddedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func APIComponentsSchemaRemovedCheck

func APIComponentsSchemaRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func APIComponentsSecurityUpdatedCheck

func APIComponentsSecurityUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func APIDeprecationCheck

func APIDeprecationCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func APIOperationIdUpdatedCheck

func APIOperationIdUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func APIRemovedCheck

func APIRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func APISecurityUpdatedCheck

func APISecurityUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func APISunsetChangedCheck

func APISunsetChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func APITagUpdatedCheck

func APITagUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func AddedRequiredRequestBodyCheck

func AddedRequiredRequestBodyCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func CheckBackwardCompatibility

func CheckBackwardCompatibility(config Config, diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap) Changes

func CheckBackwardCompatibilityUntilLevel

func CheckBackwardCompatibilityUntilLevel(config Config, diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, level Level) Changes

func NewRequestNonPathDefaultParameterCheck added in v1.8.2

func NewRequestNonPathDefaultParameterCheck(diffReport *diff.Diff, _ *diff.OperationsSourcesMap, config Config) Changes

func NewRequestNonPathParameterCheck

func NewRequestNonPathParameterCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func NewRequestPathParameterCheck

func NewRequestPathParameterCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func NewRequiredRequestHeaderPropertyCheck

func NewRequiredRequestHeaderPropertyCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ProcessIgnoredBackwardCompatibilityErrors

func ProcessIgnoredBackwardCompatibilityErrors(level Level, errs Changes, ignoreFile string) (Changes, error)

func RequestBodyBecameEnumCheck

func RequestBodyBecameEnumCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestBodyEnumValueRemovedCheck

func RequestBodyEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestBodyMediaTypeChangedCheck

func RequestBodyMediaTypeChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestBodyRequiredUpdatedCheck

func RequestBodyRequiredUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestDiscriminatorUpdatedCheck

func RequestDiscriminatorUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestHeaderPropertyBecameEnumCheck

func RequestHeaderPropertyBecameEnumCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestHeaderPropertyBecameRequiredCheck

func RequestHeaderPropertyBecameRequiredCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterBecameEnumCheck

func RequestParameterBecameEnumCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterDefaultValueChanged

func RequestParameterDefaultValueChanged(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterEnumValueUpdatedCheck

func RequestParameterEnumValueUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterMaxItemsUpdatedCheck

func RequestParameterMaxItemsUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterMaxLengthSetCheck

func RequestParameterMaxLengthSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterMaxLengthUpdatedCheck

func RequestParameterMaxLengthUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterMaxSetCheck

func RequestParameterMaxSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterMaxUpdatedCheck

func RequestParameterMaxUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterMinItemsSetCheck

func RequestParameterMinItemsSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterMinItemsUpdatedCheck

func RequestParameterMinItemsUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterMinLengthUpdatedCheck

func RequestParameterMinLengthUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterMinSetCheck

func RequestParameterMinSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterMinUpdatedCheck

func RequestParameterMinUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterPatternAddedOrChangedCheck

func RequestParameterPatternAddedOrChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterRemovedCheck

func RequestParameterRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterRequiredValueUpdatedCheck

func RequestParameterRequiredValueUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterTypeChangedCheck

func RequestParameterTypeChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestParameterXExtensibleEnumValueRemovedCheck

func RequestParameterXExtensibleEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyAllOfUpdated

func RequestPropertyAllOfUpdated(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyAnyOfUpdated

func RequestPropertyAnyOfUpdated(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyBecameEnumCheck

func RequestPropertyBecameEnumCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyBecameNotNullableCheck

func RequestPropertyBecameNotNullableCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyDefaultValueChangedCheck

func RequestPropertyDefaultValueChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyEnumValueUpdatedCheck

func RequestPropertyEnumValueUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyMaxDecreasedCheck

func RequestPropertyMaxDecreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyMaxLengthSetCheck

func RequestPropertyMaxLengthSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyMaxLengthUpdatedCheck

func RequestPropertyMaxLengthUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyMaxSetCheck

func RequestPropertyMaxSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyMinIncreasedCheck

func RequestPropertyMinIncreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyMinItemsIncreasedCheck

func RequestPropertyMinItemsIncreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyMinItemsSetCheck

func RequestPropertyMinItemsSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyMinLengthUpdatedCheck

func RequestPropertyMinLengthUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyMinSetCheck

func RequestPropertyMinSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyOneOfUpdated

func RequestPropertyOneOfUpdated(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyPatternUpdatedCheck

func RequestPropertyPatternUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyRequiredUpdatedCheck

func RequestPropertyRequiredUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyTypeChangedCheck

func RequestPropertyTypeChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyUpdatedCheck

func RequestPropertyUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyWriteOnlyReadOnlyCheck

func RequestPropertyWriteOnlyReadOnlyCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func RequestPropertyXExtensibleEnumValueRemovedCheck

func RequestPropertyXExtensibleEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseDiscriminatorUpdatedCheck

func ResponseDiscriminatorUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseHeaderBecameOptional

func ResponseHeaderBecameOptional(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseHeaderRemoved

func ResponseHeaderRemoved(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseMediaTypeEnumValueRemovedCheck

func ResponseMediaTypeEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseMediaTypeUpdated

func ResponseMediaTypeUpdated(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseNonSuccessStatusUpdated

func ResponseNonSuccessStatusUpdated(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseOptionalPropertyUpdatedCheck

func ResponseOptionalPropertyUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseOptionalPropertyWriteOnlyReadOnlyCheck

func ResponseOptionalPropertyWriteOnlyReadOnlyCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseParameterEnumValueRemovedCheck

func ResponseParameterEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePatternAddedOrChangedCheck

func ResponsePatternAddedOrChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyAllOfUpdated

func ResponsePropertyAllOfUpdated(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyAnyOfUpdated

func ResponsePropertyAnyOfUpdated(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyBecameNullableCheck

func ResponsePropertyBecameNullableCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyBecameOptionalCheck

func ResponsePropertyBecameOptionalCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyBecameRequiredCheck

func ResponsePropertyBecameRequiredCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyDefaultValueChangedCheck

func ResponsePropertyDefaultValueChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyEnumValueAddedCheck

func ResponsePropertyEnumValueAddedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyMaxIncreasedCheck

func ResponsePropertyMaxIncreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyMaxLengthIncreasedCheck

func ResponsePropertyMaxLengthIncreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyMaxLengthUnsetCheck

func ResponsePropertyMaxLengthUnsetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyMinDecreasedCheck

func ResponsePropertyMinDecreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyMinItemsDecreasedCheck

func ResponsePropertyMinItemsDecreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyMinItemsUnsetCheck

func ResponsePropertyMinItemsUnsetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyMinLengthDecreasedCheck

func ResponsePropertyMinLengthDecreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyOneOfUpdated

func ResponsePropertyOneOfUpdated(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponsePropertyTypeChangedCheck

func ResponsePropertyTypeChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseRequiredPropertyUpdatedCheck

func ResponseRequiredPropertyUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseRequiredPropertyWriteOnlyReadOnlyCheck

func ResponseRequiredPropertyWriteOnlyReadOnlyCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func ResponseStatusUpdated

func ResponseStatusUpdated(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config, filter func(int) bool, id string, defaultLevel Level) Changes

func ResponseSuccessStatusUpdated

func ResponseSuccessStatusUpdated(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func UncheckedRequestAllOfWarnCheck

func UncheckedRequestAllOfWarnCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func UncheckedResponseAllOfWarnCheck

func UncheckedResponseAllOfWarnCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config Config) Changes

func (Changes) GetLevelCount

func (changes Changes) GetLevelCount() map[Level]int

func (Changes) HasLevelOrHigher

func (changes Changes) HasLevelOrHigher(level Level) bool

func (Changes) Len

func (changes Changes) Len() int

func (Changes) Less

func (changes Changes) Less(i, j int) bool

func (Changes) Swap

func (changes Changes) Swap(i, j int)

type ComponentChange

type ComponentChange struct {
	Id      string `json:"id,omitempty" yaml:"id,omitempty"`
	Text    string `json:"text,omitempty" yaml:"text,omitempty"`
	Comment string `json:"comment,omitempty" yaml:"comment,omitempty"`
	Level   Level  `json:"level" yaml:"level"`
	Source  string `json:"source,omitempty" yaml:"source,omitempty"`
}

ComponentChange represnts a change in the Components Section: https://swagger.io/docs/specification/components/

func (ComponentChange) Error

func (c ComponentChange) Error() string

func (ComponentChange) GetComment

func (c ComponentChange) GetComment() string

func (ComponentChange) GetId

func (c ComponentChange) GetId() string

func (ComponentChange) GetLevel

func (c ComponentChange) GetLevel() Level

func (ComponentChange) GetOperation

func (ComponentChange) GetOperation() string

func (ComponentChange) GetOperationId

func (ComponentChange) GetOperationId() string

func (ComponentChange) GetPath

func (ComponentChange) GetPath() string

func (ComponentChange) GetText

func (c ComponentChange) GetText() string

func (ComponentChange) LocalizedError

func (c ComponentChange) LocalizedError(l Localizer) string

func (ComponentChange) MatchIgnore

func (ComponentChange) MatchIgnore(ignorePath, ignoreLine string) bool

func (ComponentChange) PrettyErrorText

func (c ComponentChange) PrettyErrorText(l Localizer) string

type Config

type Config struct {
	Checks              []BackwardCompatibilityCheck
	MinSunsetBetaDays   int
	MinSunsetStableDays int
	Localize            Localizer
	LogLevelOverrides   map[string]Level
}

func GetAllChecks

func GetAllChecks(includeChecks utils.StringList, deprecationDaysBeta int, deprecationDaysStable int) Config

func GetChecks

func GetChecks(includeChecks utils.StringList) Config

func GetDefaultChecks

func GetDefaultChecks() Config

type Level

type Level int
const (
	ERR  Level = 3
	WARN Level = 2
	INFO Level = 1
)

func ConditionalError

func ConditionalError(isConditionSatisfied bool) Level

func NewLevel

func NewLevel(level string) (Level, error)

func (Level) PrettyString

func (level Level) PrettyString() string

func (Level) String

func (level Level) String() string

type Localizer

type Localizer func(key string, args ...interface{}) string

func NewLocalizer

func NewLocalizer(locale string, fallbackLocale string) Localizer

type SecurityChange

type SecurityChange struct {
	Id      string `json:"id,omitempty" yaml:"id,omitempty"`
	Text    string `json:"text,omitempty" yaml:"text,omitempty"`
	Comment string `json:"comment,omitempty" yaml:"comment,omitempty"`
	Level   Level  `json:"level" yaml:"level"`
	Source  string `json:"source,omitempty" yaml:"source,omitempty"`
}

SecurityChange represnts a change in the Security Section (not to be confised with components/securitySchemes)

func (SecurityChange) Error

func (c SecurityChange) Error() string

func (SecurityChange) GetComment

func (c SecurityChange) GetComment() string

func (SecurityChange) GetId

func (c SecurityChange) GetId() string

func (SecurityChange) GetLevel

func (c SecurityChange) GetLevel() Level

func (SecurityChange) GetOperation

func (r SecurityChange) GetOperation() string

func (SecurityChange) GetOperationId

func (SecurityChange) GetOperationId() string

func (SecurityChange) GetPath

func (SecurityChange) GetPath() string

func (SecurityChange) GetText

func (c SecurityChange) GetText() string

func (SecurityChange) LocalizedError

func (c SecurityChange) LocalizedError(l Localizer) string

func (SecurityChange) MatchIgnore

func (SecurityChange) MatchIgnore(ignorePath, ignoreLine string) bool

func (SecurityChange) PrettyErrorText

func (c SecurityChange) PrettyErrorText(l Localizer) string

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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