checker

package
v1.10.27 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Overview

Package checker finds breaking-changes accoss openapi specifications.

Index

Examples

Constants

View Source
const (
	AddedRequiredRequestBodyId = "request-body-added-required"
	AddedOptionalRequestBodyId = "request-body-added-optional"
)
View Source
const (
	EndpointReactivatedId        = "endpoint-reactivated"
	APIDeprecatedSunsetParseId   = "api-deprecated-sunset-parse"
	APIDeprecatedSunsetMissingId = "api-deprecated-sunset-missing"
	APIInvalidStabilityLevelId   = "api-invalid-stability-level"
	APISunsetDateTooSmallId      = "api-sunset-date-too-small"
	EndpointDeprecatedId         = "endpoint-deprecated"
)
View Source
const (
	APIOperationIdRemovedId = "api-operation-id-removed"
	APIOperationIdAddId     = "api-operation-id-added"
)
View Source
const (
	APIPathRemovedWithoutDeprecationId = "api-path-removed-without-deprecation"
	APIPathRemovedWithDeprecationId    = "api-path-removed-with-deprecation"
	APIPathSunsetParseId               = "api-path-sunset-parse"
	APIPathRemovedBeforeSunsetId       = "api-path-removed-before-sunset"
	APIRemovedWithoutDeprecationId     = "api-removed-without-deprecation"
	APIRemovedWithDeprecationId        = "api-removed-with-deprecation"
	APIRemovedBeforeSunsetId           = "api-removed-before-sunset"
)
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 (
	APISunsetDeletedId             = "sunset-deleted"
	APISunsetDateChangedTooSmallId = "api-sunset-date-changed-too-small"
)
View Source
const (
	STABILITY_DRAFT  = "draft"
	STABILITY_ALPHA  = "alpha"
	STABILITY_BETA   = "beta"
	STABILITY_STABLE = "stable"
)
View Source
const (
	APITagRemovedId = "api-tag-removed"
	APITagAddedId   = "api-tag-added"
)
View Source
const (
	APISchemasRemovedId = "api-schema-removed"
	ComponentSchemas    = "schemas"
)
View Source
const (
	APIComponentsSecurityRemovedId                  = "api-security-component-removed"
	APIComponentsSecurityAddedId                    = "api-security-component-added"
	APIComponentsSecurityComponentOauthUrlUpdatedId = "api-security-component-oauth-url-changed"
	APIComponentsSecurityTypeUpdatedId              = "api-security-component-type-changed"
	APIComponentsSecurityOauthTokenUrlUpdatedId     = "api-security-component-oauth-token-url-changed"
	APIComponentSecurityOauthScopeAddedId           = "api-security-component-oauth-scope-added"
	APIComponentSecurityOauthScopeRemovedId         = "api-security-component-oauth-scope-removed"
	APIComponentSecurityOauthScopeUpdatedId         = "api-security-component-oauth-scope-changed"
)
View Source
const (
	NewRequiredRequestDefaultParameterToExistingPathId = "new-required-request-default-parameter-to-existing-path"
	NewOptionalRequestDefaultParameterToExistingPathId = "new-optional-request-default-parameter-to-existing-path"
)
View Source
const (
	NewRequiredRequestParameterId = "new-required-request-parameter"
	NewOptionalRequestParameterId = "new-optional-request-parameter"
)
View Source
const (
	RequestBodyMediaTypeAddedId   = "request-body-media-type-added"
	RequestBodyMediaTypeRemovedId = "request-body-media-type-removed"
)
View Source
const (
	RequestBodyBecameOptionalId = "request-body-became-optional"
	RequestBodyBecameRequiredId = "request-body-became-required"
)
View Source
const (
	RequestBodyDiscriminatorAddedId                   = "request-body-discriminator-added"
	RequestBodyDiscriminatorRemovedId                 = "request-body-discriminator-removed"
	RequestBodyDiscriminatorPropertyNameChangedId     = "request-body-discriminator-property-name-changed"
	RequestBodyDiscriminatorMappingAddedId            = "request-body-discriminator-mapping-added"
	RequestBodyDiscriminatorMappingDeletedId          = "request-body-discriminator-mapping-deleted"
	RequestBodyDiscriminatorMappingChangedId          = "request-body-discriminator-mapping-changed"
	RequestPropertyDiscriminatorAddedId               = "request-property-discriminator-added"
	RequestPropertyDiscriminatorRemovedId             = "request-property-discriminator-removed"
	RequestPropertyDiscriminatorPropertyNameChangedId = "request-property-discriminator-property-name-changed"
	RequestPropertyDiscriminatorMappingAddedId        = "request-property-discriminator-mapping-added"
	RequestPropertyDiscriminatorMappingDeletedId      = "request-property-discriminator-mapping-deleted"
	RequestPropertyDiscriminatorMappingChangedId      = "request-property-discriminator-mapping-changed"
)
View Source
const (
	RequestParameterEnumValueAddedId   = "request-parameter-enum-value-added"
	RequestParameterEnumValueRemovedId = "request-parameter-enum-value-removed"
)
View Source
const (
	RequestParameterPatternAddedId       = "request-parameter-pattern-added"
	RequestParameterPatternRemovedId     = "request-parameter-pattern-removed"
	RequestParameterPatternChangedId     = "request-parameter-pattern-changed"
	RequestParameterPatternGeneralizedId = "request-parameter-pattern-generalized"
	PatternChangedCommentId              = "pattern-changed-warn-comment"
)
View Source
const (
	RequestParameterBecomeRequiredId = "request-parameter-became-required"
	RequestParameterBecomeOptionalId = "request-parameter-became-optional"
)
View Source
const (
	RequestParameterDefaultValueChangedId = "request-parameter-default-value-changed"
	RequestParameterDefaultValueAddedId   = "request-parameter-default-value-added"
	RequestParameterDefaultValueRemovedId = "request-parameter-default-value-removed"
)
View Source
const (
	RequestParameterMaxItemsIncreasedId = "request-parameter-max-items-increased"
	RequestParameterMaxItemsDecreasedId = "request-parameter-max-items-decreased"
)
View Source
const (
	RequestParameterMaxLengthDecreasedId = "request-parameter-max-length-decreased"
	RequestParameterMaxLengthIncreasedId = "request-parameter-max-length-increased"
)
View Source
const (
	RequestParameterMaxDecreasedId = "request-parameter-max-decreased"
	RequestParameterMaxIncreasedId = "request-parameter-max-increased"
)
View Source
const (
	RequestParameterMinItemsIncreasedId = "request-parameter-min-items-increased"
	RequestParameterMinItemsDecreasedId = "request-parameter-min-items-decreased"
)
View Source
const (
	RequestParameterMinLengthIncreasedId = "request-parameter-min-length-increased"
	RequestParameterMinLengthDecreasedId = "request-parameter-min-length-decreased"
)
View Source
const (
	RequestParameterMinIncreasedId = "request-parameter-min-increased"
	RequestParameterMinDecreasedId = "request-parameter-min-decreased"
)
View Source
const (
	RequestParameterTypeChangedId                = "request-parameter-type-changed"
	RequestParameterTypeGeneralizedId            = "request-parameter-type-generalized"
	RequestParameterPropertyTypeChangedId        = "request-parameter-property-type-changed"
	RequestParameterPropertyTypeGeneralizedId    = "request-parameter-property-type-generalized"
	RequestParameterPropertyTypeSpecializedId    = "request-parameter-property-type-specialized"
	RequestParameterPropertyTypeChangedCommentId = "request-parameter-property-type-changed-warn-comment"
)
View Source
const (
	RequestBodyAllOfAddedId       = "request-body-all-of-added"
	RequestBodyAllOfRemovedId     = "request-body-all-of-removed"
	RequestPropertyAllOfAddedId   = "request-property-all-of-added"
	RequestPropertyAllOfRemovedId = "request-property-all-of-removed"
)
View Source
const (
	RequestBodyAnyOfAddedId       = "request-body-any-of-added"
	RequestBodyAnyOfRemovedId     = "request-body-any-of-removed"
	RequestPropertyAnyOfAddedId   = "request-property-any-of-added"
	RequestPropertyAnyOfRemovedId = "request-property-any-of-removed"
)
View Source
const (
	RequestBodyBecomeNotNullableId     = "request-body-became-not-nullable"
	RequestBodyBecomeNullableId        = "request-body-became-nullable"
	RequestPropertyBecomeNotNullableId = "request-property-became-not-nullable"
	RequestPropertyBecomeNullableId    = "request-property-became-nullable"
)
View Source
const (
	RequestBodyDefaultValueAddedId       = "request-body-default-value-added"
	RequestBodyDefaultValueRemovedId     = "request-body-default-value-removed"
	RequestBodyDefaultValueChangedId     = "request-body-default-value-changed"
	RequestPropertyDefaultValueAddedId   = "request-property-default-value-added"
	RequestPropertyDefaultValueRemovedId = "request-property-default-value-removed"
	RequestPropertyDefaultValueChangedId = "request-property-default-value-changed"
)
View Source
const (
	RequestPropertyEnumValueRemovedId         = "request-property-enum-value-removed"
	RequestReadOnlyPropertyEnumValueRemovedId = "request-read-only-property-enum-value-removed"
	RequestPropertyEnumValueAddedId           = "request-property-enum-value-added"
)
View Source
const (
	RequestBodyMaxLengthSetId     = "request-body-max-length-set"
	RequestPropertyMaxLengthSetId = "request-property-max-length-set"
)
View Source
const (
	RequestBodyMaxLengthDecreasedId             = "request-body-max-length-decreased"
	RequestBodyMaxLengthIncreasedId             = "request-body-max-length-increased"
	RequestPropertyMaxLengthDecreasedId         = "request-property-max-length-decreased"
	RequestReadOnlyPropertyMaxLengthDecreasedId = "request-read-only-property-max-length-decreased"
	RequestPropertyMaxLengthIncreasedId         = "request-property-max-length-increased"
)
View Source
const (
	RequestBodyMaxSetId     = "request-body-max-set"
	RequestPropertyMaxSetId = "request-property-max-set"
)
View Source
const (
	RequestBodyMaxDecreasedId             = "request-body-max-decreased"
	RequestBodyMaxIncreasedId             = "request-body-max-increased"
	RequestPropertyMaxDecreasedId         = "request-property-max-decreased"
	RequestReadOnlyPropertyMaxDecreasedId = "request-read-only-property-max-decreased"
	RequestPropertyMaxIncreasedId         = "request-property-max-increased"
)
View Source
const (
	RequestBodyMinItemsIncreasedId     = "request-body-min-items-increased"
	RequestPropertyMinItemsIncreasedId = "request-property-min-items-increased"
)
View Source
const (
	RequestBodyMinItemsSetId     = "request-body-min-items-set"
	RequestPropertyMinItemsSetId = "request-property-min-items-set"
)
View Source
const (
	RequestBodyMinLengthIncreasedId     = "request-body-min-length-increased"
	RequestBodyMinLengthDecreasedId     = "request-body-min-length-decreased"
	RequestPropertyMinLengthIncreasedId = "request-property-min-length-increased"
	RequestPropertyMinLengthDecreasedId = "request-property-min-length-decreased"
)
View Source
const (
	RequestBodyMinSetId     = "request-body-min-set"
	RequestPropertyMinSetId = "request-property-min-set"
)
View Source
const (
	RequestBodyMinIncreasedId             = "request-body-min-increased"
	RequestBodyMinDecreasedId             = "request-body-min-decreased"
	RequestPropertyMinIncreasedId         = "request-property-min-increased"
	RequestReadOnlyPropertyMinIncreasedId = "request-read-only-property-min-increased"
	RequestPropertyMinDecreasedId         = "request-property-min-decreased"
)
View Source
const (
	RequestBodyOneOfAddedId       = "request-body-one-of-added"
	RequestBodyOneOfRemovedId     = "request-body-one-of-removed"
	RequestPropertyOneOfAddedId   = "request-property-one-of-added"
	RequestPropertyOneOfRemovedId = "request-property-one-of-removed"
)
View Source
const (
	RequestPropertyPatternRemovedId     = "request-property-pattern-removed"
	RequestPropertyPatternAddedId       = "request-property-pattern-added"
	RequestPropertyPatternChangedId     = "request-property-pattern-changed"
	RequestPropertyPatternGeneralizedId = "request-property-pattern-generalized"
)
View Source
const (
	RequestPropertyBecameRequiredId            = "request-property-became-required"
	RequestPropertyBecameRequiredWithDefaultId = "request-property-became-required-with-default"
	RequestPropertyBecameOptionalId            = "request-property-became-optional"
)
View Source
const (
	RequestBodyTypeGeneralizedId     = "request-body-type-generalized"
	RequestBodyTypeChangedId         = "request-body-type-changed"
	RequestPropertyTypeGeneralizedId = "request-property-type-generalized"
	RequestPropertyTypeChangedId     = "request-property-type-changed"
)
View Source
const (
	RequestPropertyRemovedId                = "request-property-removed"
	NewRequiredRequestPropertyId            = "new-required-request-property"
	NewRequiredRequestPropertyWithDefaultId = "new-required-request-property-with-default"
	NewOptionalRequestPropertyId            = "new-optional-request-property"
)
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 (
	ResponseBodyDiscriminatorAddedId                   = "response-body-discriminator-added"
	ResponseBodyDiscriminatorRemovedId                 = "response-body-discriminator-removed"
	ResponseBodyDiscriminatorPropertyNameChangedId     = "response-body-discriminator-property-name-changed"
	ResponseBodyDiscriminatorMappingAddedId            = "response-body-discriminator-mapping-added"
	ResponseBodyDiscriminatorMappingDeletedId          = "response-body-discriminator-mapping-deleted"
	ResponseBodyDiscriminatorMappingChangedId          = "response-body-discriminator-mapping-changed"
	ResponsePropertyDiscriminatorAddedId               = "response-property-discriminator-added"
	ResponsePropertyDiscriminatorRemovedId             = "response-property-discriminator-removed"
	ResponsePropertyDiscriminatorPropertyNameChangedId = "response-property-discriminator-property-name-changed"
	ResponsePropertyDiscriminatorMappingAddedId        = "response-property-discriminator-mapping-added"
	ResponsePropertyDiscriminatorMappingDeletedId      = "response-property-discriminator-mapping-deleted"
	ResponsePropertyDiscriminatorMappingChangedId      = "response-property-discriminator-mapping-changed"
)
View Source
const (
	RequiredResponseHeaderRemovedId = "required-response-header-removed"
	OptionalResponseHeaderRemovedId = "optional-response-header-removed"
)
View Source
const (
	ResponseMediaTypeRemovedId = "response-media-type-removed"
	ResponseMediaTypeAddedId   = "response-media-type-added"
)
View Source
const (
	ResponseOptionalPropertyRemovedId          = "response-optional-property-removed"
	ResponseOptionalWriteOnlyPropertyRemovedId = "response-optional-write-only-property-removed"
	ResponseOptionalPropertyAddedId            = "response-optional-property-added"
	ResponseOptionalWriteOnlyPropertyAddedId   = "response-optional-write-only-property-added"
)
View Source
const (
	ResponseOptionalPropertyBecameNonWriteOnlyId = "response-optional-property-became-not-write-only"
	ResponseOptionalPropertyBecameWriteOnlyId    = "response-optional-property-became-write-only"
	ResponseOptionalPropertyBecameReadOnlyId     = "response-optional-property-became-read-only"
	ResponseOptionalPropertyBecameNonReadOnlyId  = "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 (
	ResponseBodyAllOfAddedId       = "response-body-all-of-added"
	ResponseBodyAllOfRemovedId     = "response-body-all-of-removed"
	ResponsePropertyAllOfAddedId   = "response-property-all-of-added"
	ResponsePropertyAllOfRemovedId = "response-property-all-of-removed"
)
View Source
const (
	ResponseBodyAnyOfAddedId       = "response-body-any-of-added"
	ResponseBodyAnyOfRemovedId     = "response-body-any-of-removed"
	ResponsePropertyAnyOfAddedId   = "response-property-any-of-added"
	ResponsePropertyAnyOfRemovedId = "response-property-any-of-removed"
)
View Source
const (
	ResponsePropertyBecameNullableId = "response-property-became-nullable"
	ResponseBodyBecameNullableId     = "response-body-became-nullable"
)
View Source
const (
	ResponsePropertyBecameOptionalId          = "response-property-became-optional"
	ResponseWriteOnlyPropertyBecameOptionalId = "response-write-only-property-became-optional"
)
View Source
const (
	ResponsePropertyBecameRequiredId          = "response-property-became-required"
	ResponseWriteOnlyPropertyBecameRequiredId = "response-write-only-property-became-required"
)
View Source
const (
	ResponseBodyDefaultValueAddedId       = "response-body-default-value-added"
	ResponseBodyDefaultValueRemovedId     = "response-body-default-value-removed"
	ResponseBodyDefaultValueChangedId     = "response-body-default-value-changed"
	ResponsePropertyDefaultValueAddedId   = "response-property-default-value-added"
	ResponsePropertyDefaultValueRemovedId = "response-property-default-value-removed"
	ResponsePropertyDefaultValueChangedId = "response-property-default-value-changed"
)
View Source
const (
	ResponsePropertyEnumValueAddedId          = "response-property-enum-value-added"
	ResponseWriteOnlyPropertyEnumValueAddedId = "response-write-only-property-enum-value-added"
)
View Source
const (
	ResponseBodyMaxIncreasedId     = "response-body-max-increased"
	ResponsePropertyMaxIncreasedId = "response-property-max-increased"
)
View Source
const (
	ResponseBodyMaxLengthIncreasedId     = "response-body-max-length-increased"
	ResponsePropertyMaxLengthIncreasedId = "response-property-max-length-increased"
)
View Source
const (
	ResponseBodyMaxLengthUnsetId     = "response-body-max-length-unset"
	ResponsePropertyMaxLengthUnsetId = "response-property-max-length-unset"
)
View Source
const (
	ResponseBodyMinDecreasedId     = "response-body-min-decreased"
	ResponsePropertyMinDecreasedId = "response-property-min-decreased"
)
View Source
const (
	ResponseBodyMinItemsDecreasedId     = "response-body-min-items-decreased"
	ResponsePropertyMinItemsDecreasedId = "response-property-min-items-decreased"
)
View Source
const (
	ResponseBodyMinItemsUnsetId     = "response-body-min-items-unset"
	ResponsePropertyMinItemsUnsetId = "response-property-min-items-unset"
)
View Source
const (
	ResponseBodyMinLengthDecreasedId     = "response-body-min-length-decreased"
	ResponsePropertyMinLengthDecreasedId = "response-property-min-length-decreased"
)
View Source
const (
	ResponseBodyOneOfAddedId       = "response-body-one-of-added"
	ResponseBodyOneOfRemovedId     = "response-body-one-of-removed"
	ResponsePropertyOneOfAddedId   = "response-property-one-of-added"
	ResponsePropertyOneOfRemovedId = "response-property-one-of-removed"
)
View Source
const (
	ResponseBodyTypeChangedId     = "response-body-type-changed"
	ResponsePropertyTypeChangedId = "response-property-type-changed"
)
View Source
const (
	ResponseRequiredPropertyRemovedId          = "response-required-property-removed"
	ResponseRequiredWriteOnlyPropertyRemovedId = "response-required-write-only-property-removed"
	ResponseRequiredPropertyAddedId            = "response-required-property-added"
	ResponseRequiredWriteOnlyPropertyAddedId   = "response-required-write-only-property-added"
)
View Source
const (
	ResponseRequiredPropertyBecameNonWriteOnlyId = "response-required-property-became-not-write-only"
	ResponseRequiredPropertyBecameWriteOnlyId    = "response-required-property-became-write-only"
	ResponseRequiredPropertyBecameReadOnlyId     = "response-required-property-became-read-only"
	ResponseRequiredPropertyBecameNonReadOnlyId  = "response-required-property-became-not-read-only"
)
View Source
const (
	ResponseSuccessStatusRemovedId    = "response-success-status-removed"
	ResponseNonSuccessStatusRemovedId = "response-non-success-status-removed"
	ResponseSuccessStatusAddedId      = "response-success-status-added"
	ResponseNonSuccessStatusAddedId   = "response-non-success-status-added"
)
View Source
const (
	DefaultBetaDeprecationDays   = uint(0)
	DefaultStableDeprecationDays = uint(0)
)
View Source
const (
	APIStabilityDecreasedId = "api-stability-decreased"
)
View Source
const ComponentSecuritySchemes = "securitySchemes"
View Source
const (
	EndpointAddedId = "endpoint-added"
)
View Source
const (
	NewRequestPathParameterId = "new-request-path-parameter"
)
View Source
const (
	NewRequiredRequestHeaderPropertyId = "new-required-request-header-property"
)
View Source
const (
	RequestBodyBecameEnumId = "request-body-became-enum"
)
View Source
const (
	RequestBodyEnumValueRemovedId = "request-body-enum-value-removed"
)
View Source
const (
	RequestHeaderPropertyBecameEnumId = "request-header-property-became-enum"
)
View Source
const (
	RequestHeaderPropertyBecameRequiredId = "request-header-property-became-required"
)
View Source
const (
	RequestParameterBecameEnumId = "request-parameter-became-enum"
)
View Source
const (
	RequestParameterMaxLengthSetId = "request-parameter-max-length-set"
)
View Source
const (
	RequestParameterMaxSetId = "request-parameter-max-set"
)
View Source
const (
	RequestParameterMinItemsSetId = "request-parameter-min-items-set"
)
View Source
const (
	RequestParameterMinSetId = "request-parameter-min-set"
)
View Source
const (
	RequestParameterRemovedId = "request-parameter-removed"
)
View Source
const (
	RequestParameterXExtensibleEnumValueRemovedId = "request-parameter-x-extensible-enum-value-removed"
)
View Source
const (
	RequestPropertyBecameEnumId = "request-property-became-enum"
)
View Source
const (
	RequestPropertyXExtensibleEnumValueRemovedId = "request-property-x-extensible-enum-value-removed"
)
View Source
const (
	ResponseHeaderBecameOptionalId = "response-header-became-optional"
)
View Source
const (
	ResponseMediaTypeEnumValueRemovedId = "response-mediatype-enum-value-removed"
)
View Source
const (
	ResponsePropertyEnumValueRemovedId = "response-property-enum-value-removed"
)

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 GetAllRuleIds added in v1.10.21

func GetAllRuleIds() []string

func GetCheckLevels added in v1.10.21

func GetCheckLevels() map[string]Level

GetCheckLevels gets levels for all backward compatibility checks

func GetOptionalRuleIds added in v1.10.17

func GetOptionalRuleIds() []string

func GetSeverityLevels added in v1.10.21

func GetSeverityLevels(source io.Reader) (map[string]Level, error)

GetSeverityLevels reads severity levels from a reader and returns a map of severity levels

func GetSupportedColorValues added in v1.10.24

func GetSupportedColorValues() []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 ProcessSeverityLevels added in v1.10.21

func ProcessSeverityLevels(file string) (map[string]Level, error)

ProcessSeverityLevels reads a file with severity levels and returns a map of severity levels

func SetPipedOutput added in v1.9.7

func SetPipedOutput(val *bool) *bool

Types

type Action added in v1.10.22

type Action int8
const (
	ActionAdd Action = iota
	ActionRemove
	ActionChange
	ActionGeneralize
	ActionSpecialize
	ActionIncrease
	ActionDecrease
	ActionSet
	ActionNone
)

type ApiChange added in v1.6.0

type ApiChange struct {
	CommonChange

	Id          string
	Args        []any
	Comment     string
	Level       Level
	Operation   string
	OperationId string
	Path        string
	Source      *load.Source

	SourceFile      string
	SourceLine      int
	SourceLineEnd   int
	SourceColumn    int
	SourceColumnEnd int
}

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

func NewApiChange added in v1.10.18

func NewApiChange(id string, config *Config, args []any, comment string, operationsSources *diff.OperationsSourcesMap, operation *openapi3.Operation, method, path string) ApiChange

func (ApiChange) GetArgs added in v1.10.0

func (c ApiChange) GetArgs() []any

func (ApiChange) GetComment added in v1.6.0

func (c ApiChange) GetComment(l Localizer) string

func (ApiChange) GetId added in v1.6.0

func (c ApiChange) GetId() string

func (ApiChange) GetLevel added in v1.6.0

func (c ApiChange) GetLevel() Level

func (ApiChange) GetOperation added in v1.6.0

func (c ApiChange) GetOperation() string

func (ApiChange) GetOperationId added in v1.6.0

func (c ApiChange) GetOperationId() string

func (ApiChange) GetPath added in v1.6.0

func (c ApiChange) GetPath() string

func (ApiChange) GetSection added in v1.10.0

func (c ApiChange) GetSection() string

func (ApiChange) GetSource added in v1.10.0

func (c ApiChange) GetSource() string

func (ApiChange) GetSourceColumn added in v1.9.0

func (c ApiChange) GetSourceColumn() int

func (ApiChange) GetSourceColumnEnd added in v1.9.0

func (c ApiChange) GetSourceColumnEnd() int

func (ApiChange) GetSourceFile added in v1.9.0

func (c ApiChange) GetSourceFile() string

func (ApiChange) GetSourceLine added in v1.9.0

func (c ApiChange) GetSourceLine() int

func (ApiChange) GetSourceLineEnd added in v1.9.0

func (c ApiChange) GetSourceLineEnd() int

func (ApiChange) GetText added in v1.6.0

func (c ApiChange) GetText(l Localizer) string

func (ApiChange) GetUncolorizedText added in v1.10.0

func (c ApiChange) GetUncolorizedText(l Localizer) string

func (ApiChange) IsBreaking added in v1.9.5

func (c ApiChange) IsBreaking() bool

func (ApiChange) MatchIgnore added in v1.6.0

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

func (ApiChange) MultiLineError added in v1.10.0

func (c ApiChange) MultiLineError(l Localizer, colorMode ColorMode) string

func (ApiChange) SingleLineError added in v1.10.0

func (c ApiChange) SingleLineError(l Localizer, colorMode ColorMode) string

type BackwardCompatibilityCheck

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

BackwardCompatibilityCheck, or a check, is a function that receives a diff report and returns a list of changes

type BackwardCompatibilityChecks added in v1.10.21

type BackwardCompatibilityChecks []BackwardCompatibilityCheck

func GetAllChecks added in v1.5.15

func GetAllChecks() BackwardCompatibilityChecks

GetAllChecks gets all backward compatibility checks

type BackwardCompatibilityRule added in v1.9.0

type BackwardCompatibilityRule struct {
	Id          string
	Level       Level
	Description string
	Handler     BackwardCompatibilityCheck
	Direction   Direction
	Location    Location
	Action      Action
}

type BackwardCompatibilityRules added in v1.10.21

type BackwardCompatibilityRules []BackwardCompatibilityRule

func GetAllRules added in v1.9.0

func GetAllRules() BackwardCompatibilityRules

func GetOptionalRules added in v1.9.0

func GetOptionalRules() BackwardCompatibilityRules

type Change added in v1.6.0

type Change interface {
	GetSection() string
	IsBreaking() bool
	GetId() string
	GetText(l Localizer) string
	GetArgs() []any
	GetUncolorizedText(l Localizer) string
	GetComment(l Localizer) string
	GetLevel() Level
	GetOperation() string
	GetOperationId() string
	GetPath() string
	GetSource() string
	GetAttributes() map[string]any
	GetSourceFile() string
	GetSourceLine() int
	GetSourceLineEnd() int
	GetSourceColumn() int
	GetSourceColumnEnd() int
	MatchIgnore(ignorePath, ignoreLine string, l Localizer) bool
	SingleLineError(l Localizer, colorMode ColorMode) string
	MultiLineError(l Localizer, colorMode ColorMode) string
}

type Changes added in v1.6.0

type Changes []Change

func APIAddedCheck added in v1.5.15

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

func APIComponentsSchemaRemovedCheck added in v1.5.14

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

func APIComponentsSecurityUpdatedCheck added in v1.5.20

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 added in v1.5.19

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 added in v1.5.20

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 added in v1.5.19

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

func AddedRequestBodyCheck added in v1.10.15

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

func CheckBackwardCompatibility

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

CheckBackwardCompatibility runs the checks with level WARN and ERR

Example
package main

import (
	"fmt"
	"os"
	"strings"

	"github.com/getkin/kin-openapi/openapi3"
	"github.com/tufin/oasdiff/checker"
	"github.com/tufin/oasdiff/diff"
	"github.com/tufin/oasdiff/load"
)

func main() {
	loader := openapi3.NewLoader()
	loader.IsExternalRefsAllowed = true

	s1, err := load.NewSpecInfo(loader, load.NewSource("../data/openapi-test1.yaml"))
	if err != nil {
		fmt.Fprintf(os.Stderr, "failed to load spec: %v", err)
		return
	}

	s2, err := load.NewSpecInfo(loader, load.NewSource("../data/openapi-test3.yaml"))
	if err != nil {
		fmt.Fprintf(os.Stderr, "failed to load spec: %v", err)
		return
	}

	diffRes, operationsSources, err := diff.GetPathsDiff(diff.NewConfig(),
		[]*load.SpecInfo{s1},
		[]*load.SpecInfo{s2},
	)

	if err != nil {
		fmt.Fprintf(os.Stderr, "diff failed with %v", err)
		return
	}

	errs := checker.CheckBackwardCompatibility(checker.NewConfig(checker.GetAllChecks()), diffRes, operationsSources)

	// process configuration file for ignoring errors
	errs, err = checker.ProcessIgnoredBackwardCompatibilityErrors(checker.ERR, errs, "../data/ignore-err-example.txt", checker.NewDefaultLocalizer())
	if err != nil {
		fmt.Fprintf(os.Stderr, "ignore errors failed with %v", err)
		return
	}

	// process configuration file for ignoring warnings
	errs, err = checker.ProcessIgnoredBackwardCompatibilityErrors(checker.WARN, errs, "../data/ignore-warn-example.txt", checker.NewDefaultLocalizer())
	if err != nil {
		fmt.Fprintf(os.Stderr, "ignore warnings failed with %v", err)
		return
	}

	// pretty print breaking changes errors
	if len(errs) > 0 {
		localizer := checker.NewDefaultLocalizer()
		count := errs.GetLevelCount()
		fmt.Print(localizer("total-errors", len(errs), count[checker.ERR], "error", count[checker.WARN], "warning"))
		for _, bcerr := range errs {
			fmt.Printf("%s\n\n", strings.TrimRight(bcerr.SingleLineError(localizer, checker.ColorNever), " "))
		}
	}

}
Output:

4 breaking changes: 1 error, 3 warning
error at ../data/openapi-test3.yaml, in API GET /api/{domain}/{project}/badges/security-score removed the success response with the status '201' [response-success-status-removed].

warning at ../data/openapi-test3.yaml, in API GET /api/{domain}/{project}/badges/security-score deleted the 'cookie' request parameter 'test' [request-parameter-removed].

warning at ../data/openapi-test3.yaml, in API GET /api/{domain}/{project}/badges/security-score deleted the 'header' request parameter 'user' [request-parameter-removed].

warning at ../data/openapi-test3.yaml, in API GET /api/{domain}/{project}/badges/security-score deleted the 'query' request parameter 'filter' [request-parameter-removed].

func CheckBackwardCompatibilityUntilLevel added in v1.5.17

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

CheckBackwardCompatibilityUntilLevel runs the checks with level equal or higher than the given level

func NewRequestNonPathDefaultParameterCheck added in v1.7.10

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

func NewRequestNonPathParameterCheck added in v1.5.18

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, l Localizer) (Changes, error)

func RequestBodyBecameEnumCheck added in v1.4.2

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

func RequestBodyEnumValueRemovedCheck added in v1.3.18

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

func RequestBodyMediaTypeChangedCheck added in v1.6.2

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

func RequestBodyRequiredUpdatedCheck added in v1.5.19

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

func RequestDiscriminatorUpdatedCheck added in v1.7.4

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

func RequestHeaderPropertyBecameEnumCheck added in v1.4.2

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 added in v1.4.2

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

func RequestParameterDefaultValueChangedCheck added in v1.9.0

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

func RequestParameterEnumValueUpdatedCheck added in v1.7.0

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

func RequestParameterMaxItemsUpdatedCheck added in v1.7.0

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 added in v1.7.0

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 added in v1.7.0

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 added in v1.7.0

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

func RequestParameterMinLengthUpdatedCheck added in v1.7.0

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 added in v1.7.0

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 added in v1.5.17

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 RequestPropertyAllOfUpdatedCheck added in v1.9.0

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

func RequestPropertyAnyOfUpdatedCheck added in v1.9.0

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

func RequestPropertyBecameEnumCheck added in v1.4.2

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

func RequestPropertyBecameNotNullableCheck added in v1.5.12

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

func RequestPropertyDefaultValueChangedCheck added in v1.7.3

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

func RequestPropertyEnumValueUpdatedCheck added in v1.7.1

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 added in v1.7.1

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 added in v1.7.1

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 RequestPropertyOneOfUpdatedCheck added in v1.9.0

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

func RequestPropertyPatternUpdatedCheck added in v1.6.6

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

func RequestPropertyRequiredUpdatedCheck added in v1.7.3

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 added in v1.7.3

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

func RequestPropertyWriteOnlyReadOnlyCheck added in v1.7.3

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 added in v1.7.4

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

func ResponseHeaderBecameOptionalCheck added in v1.9.0

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

func ResponseHeaderRemovedCheck added in v1.9.0

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

func ResponseMediaTypeEnumValueRemovedCheck added in v1.3.18

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

func ResponseMediaTypeUpdatedCheck added in v1.9.0

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

func ResponseNonSuccessStatusUpdatedCheck added in v1.9.0

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

func ResponseOptionalPropertyUpdatedCheck added in v1.5.20

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

func ResponseOptionalPropertyWriteOnlyReadOnlyCheck added in v1.6.2

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

func ResponseParameterEnumValueRemovedCheck added in v1.3.18

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

func ResponsePatternAddedOrChangedCheck added in v1.6.3

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

func ResponsePropertyAllOfUpdatedCheck added in v1.9.0

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

func ResponsePropertyAnyOfUpdatedCheck added in v1.9.0

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

func ResponsePropertyBecameNullableCheck added in v1.4.1

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 added in v1.6.0

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

func ResponsePropertyDefaultValueChangedCheck added in v1.6.3

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 added in v1.6.5

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 added in v1.5.20

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

func ResponseRequiredPropertyWriteOnlyReadOnlyCheck added in v1.6.2

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

func ResponseSuccessStatusUpdatedCheck added in v1.9.0

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

func (Changes) GetLevelCount added in v1.6.0

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

func (Changes) HasLevelOrHigher added in v1.6.0

func (changes Changes) HasLevelOrHigher(level Level) bool

func (Changes) Len added in v1.6.0

func (changes Changes) Len() int

func (Changes) Less added in v1.6.0

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

func (Changes) Swap added in v1.6.0

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

type ColorMode added in v1.10.0

type ColorMode int
const (
	ColorAlways ColorMode = iota
	ColorNever
	ColorAuto
	ColorInvalid
)

func NewColorMode added in v1.10.0

func NewColorMode(color string) (ColorMode, error)

type CommonChange added in v1.10.22

type CommonChange struct {
	Attributes map[string]any
}

func (CommonChange) GetAttributes added in v1.10.22

func (c CommonChange) GetAttributes() map[string]any

type ComponentChange added in v1.6.0

type ComponentChange struct {
	CommonChange

	Id        string
	Args      []any
	Comment   string
	Level     Level
	Component string

	SourceFile      string
	SourceLine      int
	SourceLineEnd   int
	SourceColumn    int
	SourceColumnEnd int
}

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

func (ComponentChange) GetArgs added in v1.10.0

func (c ComponentChange) GetArgs() []any

func (ComponentChange) GetComment added in v1.6.0

func (c ComponentChange) GetComment(l Localizer) string

func (ComponentChange) GetId added in v1.6.0

func (c ComponentChange) GetId() string

func (ComponentChange) GetLevel added in v1.6.0

func (c ComponentChange) GetLevel() Level

func (ComponentChange) GetOperation added in v1.6.0

func (ComponentChange) GetOperation() string

func (ComponentChange) GetOperationId added in v1.6.0

func (ComponentChange) GetOperationId() string

func (ComponentChange) GetPath added in v1.6.0

func (ComponentChange) GetPath() string

func (ComponentChange) GetSection added in v1.10.0

func (c ComponentChange) GetSection() string

func (ComponentChange) GetSource added in v1.10.0

func (c ComponentChange) GetSource() string

func (ComponentChange) GetSourceColumn added in v1.9.0

func (c ComponentChange) GetSourceColumn() int

func (ComponentChange) GetSourceColumnEnd added in v1.9.0

func (c ComponentChange) GetSourceColumnEnd() int

func (ComponentChange) GetSourceFile added in v1.9.0

func (c ComponentChange) GetSourceFile() string

func (ComponentChange) GetSourceLine added in v1.9.0

func (c ComponentChange) GetSourceLine() int

func (ComponentChange) GetSourceLineEnd added in v1.9.0

func (c ComponentChange) GetSourceLineEnd() int

func (ComponentChange) GetText added in v1.6.0

func (c ComponentChange) GetText(l Localizer) string

func (ComponentChange) GetUncolorizedText added in v1.10.0

func (c ComponentChange) GetUncolorizedText(l Localizer) string

func (ComponentChange) IsBreaking added in v1.9.5

func (c ComponentChange) IsBreaking() bool

func (ComponentChange) MatchIgnore added in v1.6.0

func (c ComponentChange) MatchIgnore(ignorePath, ignoreLine string, l Localizer) bool

func (ComponentChange) MultiLineError added in v1.10.0

func (c ComponentChange) MultiLineError(l Localizer, colorMode ColorMode) string

func (ComponentChange) SingleLineError added in v1.10.0

func (c ComponentChange) SingleLineError(l Localizer, colorMode ColorMode) string

type Config added in v1.6.0

type Config struct {
	Checks              BackwardCompatibilityChecks
	MinSunsetBetaDays   uint
	MinSunsetStableDays uint
	LogLevels           map[string]Level
	Attributes          []string
}

func NewConfig added in v1.10.17

func NewConfig(checks BackwardCompatibilityChecks) *Config

NewConfig creates a new configuration with default values.

func (*Config) WithAttributes added in v1.10.22

func (config *Config) WithAttributes(attributes []string) *Config

WithAttributes sets a list of attributes to be used.

func (*Config) WithChecks added in v1.10.17

func (config *Config) WithChecks(checks BackwardCompatibilityChecks) *Config

WithChecks sets a list of checks to be used.

func (*Config) WithDeprecation added in v1.10.17

func (config *Config) WithDeprecation(deprecationDaysBeta uint, deprecationDaysStable uint) *Config

WithDeprecation sets the number of days before sunset for deprecation warnings.

func (*Config) WithOptionalCheck added in v1.10.17

func (config *Config) WithOptionalCheck(id string) *Config

WithOptionalCheck adds a check to the list of optional checks.

func (*Config) WithOptionalChecks added in v1.10.17

func (config *Config) WithOptionalChecks(ids []string) *Config

WithOptionalChecks overrides the log level of the given checks to ERR so they will appear in `oasdiff breaking`

func (*Config) WithSeverityLevels added in v1.10.21

func (config *Config) WithSeverityLevels(severityLevels map[string]Level) *Config

func (*Config) WithSingleCheck added in v1.10.17

func (config *Config) WithSingleCheck(check BackwardCompatibilityCheck) *Config

WithSingleCheck sets a single check to be used.

type Direction added in v1.10.22

type Direction int8
const (
	DirectionRequest Direction = iota
	DirectionResponse
	DirectionNone
)

type Level added in v1.5.15

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

func NewLevel added in v1.6.0

func NewLevel(level string) (Level, error)

func (Level) IsBreaking added in v1.9.5

func (level Level) IsBreaking() bool

func (Level) PrettyString added in v1.6.0

func (level Level) PrettyString() string

func (Level) String added in v1.6.0

func (level Level) String() string

func (Level) StringCond added in v1.10.0

func (level Level) StringCond(colorMode ColorMode) string

type Localizer added in v1.7.6

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

func NewDefaultLocalizer added in v1.9.3

func NewDefaultLocalizer() Localizer

func NewLocalizer added in v1.7.6

func NewLocalizer(locale string) Localizer

type Location added in v1.10.22

type Location int8
const (
	LocationBody Location = iota
	LocationParameters
	LocationProperties
	LocationHeaders
	LocationSecurity
	LocationComponents
	LocationNone
)

type SecurityChange added in v1.6.0

type SecurityChange struct {
	CommonChange

	Id      string
	Args    []any
	Comment string
	Level   Level

	SourceFile      string
	SourceLine      int
	SourceLineEnd   int
	SourceColumn    int
	SourceColumnEnd int
}

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

func (SecurityChange) GetArgs added in v1.10.0

func (c SecurityChange) GetArgs() []any

func (SecurityChange) GetComment added in v1.6.0

func (c SecurityChange) GetComment(l Localizer) string

func (SecurityChange) GetId added in v1.6.0

func (c SecurityChange) GetId() string

func (SecurityChange) GetLevel added in v1.6.0

func (c SecurityChange) GetLevel() Level

func (SecurityChange) GetOperation added in v1.6.0

func (r SecurityChange) GetOperation() string

func (SecurityChange) GetOperationId added in v1.6.0

func (SecurityChange) GetOperationId() string

func (SecurityChange) GetPath added in v1.6.0

func (SecurityChange) GetPath() string

func (SecurityChange) GetSection added in v1.10.0

func (c SecurityChange) GetSection() string

func (SecurityChange) GetSource added in v1.10.0

func (c SecurityChange) GetSource() string

func (SecurityChange) GetSourceColumn added in v1.9.0

func (c SecurityChange) GetSourceColumn() int

func (SecurityChange) GetSourceColumnEnd added in v1.9.0

func (c SecurityChange) GetSourceColumnEnd() int

func (SecurityChange) GetSourceFile added in v1.9.0

func (c SecurityChange) GetSourceFile() string

func (SecurityChange) GetSourceLine added in v1.9.0

func (c SecurityChange) GetSourceLine() int

func (SecurityChange) GetSourceLineEnd added in v1.9.0

func (c SecurityChange) GetSourceLineEnd() int

func (SecurityChange) GetText added in v1.6.0

func (c SecurityChange) GetText(l Localizer) string

func (SecurityChange) GetUncolorizedText added in v1.10.0

func (c SecurityChange) GetUncolorizedText(l Localizer) string

func (SecurityChange) IsBreaking added in v1.9.5

func (c SecurityChange) IsBreaking() bool

func (SecurityChange) MatchIgnore added in v1.6.0

func (c SecurityChange) MatchIgnore(ignorePath, ignoreLine string, l Localizer) bool

func (SecurityChange) MultiLineError added in v1.10.0

func (c SecurityChange) MultiLineError(l Localizer, colorMode ColorMode) string

func (SecurityChange) SingleLineError added in v1.10.0

func (c SecurityChange) SingleLineError(l Localizer, colorMode ColorMode) string

Source Files

Directories

Path Synopsis
Package generator generates the breaking-changes and changelog messages for the checker package.
Package generator generates the breaking-changes and changelog messages for the checker package.

Jump to

Keyboard shortcuts

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