checker

package
v1.11.6 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

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 (
	RequestParameterReactivatedId             = "request-parameter-reactivated"
	RequestParameterDeprecatedSunsetMissingId = "request-parameter-deprecated-sunset-missing"
	RequestParameterSunsetDateTooSmallId      = "request-parameter-sunset-date-too-small"
	RequestParameterDeprecatedId              = "request-parameter-deprecated"
)
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"
	PatternAddedCommentId                = "pattern-added-error-comment"
)
View Source
const (
	RequestParameterRemovedId                = "request-parameter-removed" // this is actually the "without deprecation" case but we leave it as is for backward compatibility
	RequestParameterRemovedWithDeprecationId = "request-parameter-removed-with-deprecation"
	RequestParameterSunsetParseId            = "request-parameter-sunset-parse"
	ParameterRemovedBeforeSunsetId           = "request-parameter-removed-before-sunset"
)
View Source
const (
	RequestParameterBecomeRequiredId = "request-parameter-became-required"
	RequestParameterBecomeOptionalId = "request-parameter-became-optional"
)
View Source
const (
	RequestParameterSunsetDeletedId             = "request-parameter-sunset-deleted"
	RequestParameterSunsetDateChangedTooSmallId = "request-parameter-sunset-date-changed-too-small"
)
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 (
	ResponseMediaTypeNameChangedId     = "response-media-type-name-changed"
	ResponseMediaTypeNameGeneralizedId = "response-media-type-name-generalized"
	ResponseMediaTypeNameSpecializedId = "response-media-type-name-specialized"
)
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 (
	RequestBodyRemovedId = "request-body-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 (
	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

func GetAllRuleIds() []string

func GetCheckLevels

func GetCheckLevels() map[string]Level

GetCheckLevels gets levels for all backward compatibility checks

func GetOptionalRuleIds

func GetOptionalRuleIds() []string

func GetSeverityLevels

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

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

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

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

func SetPipedOutput

func SetPipedOutput(val *bool) *bool

Types

type Action

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

type ApiChange

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

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

NewApiChange creates a new ApiChange TODO: use opInfo to simplify the function signature

func (ApiChange) GetArgs

func (c ApiChange) GetArgs() []any

func (ApiChange) GetComment

func (c ApiChange) GetComment(l Localizer) 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) GetSection

func (c ApiChange) GetSection() string

func (ApiChange) GetSource

func (c ApiChange) GetSource() string

func (ApiChange) GetSourceColumn

func (c ApiChange) GetSourceColumn() int

func (ApiChange) GetSourceColumnEnd

func (c ApiChange) GetSourceColumnEnd() int

func (ApiChange) GetSourceFile

func (c ApiChange) GetSourceFile() string

func (ApiChange) GetSourceLine

func (c ApiChange) GetSourceLine() int

func (ApiChange) GetSourceLineEnd

func (c ApiChange) GetSourceLineEnd() int

func (ApiChange) GetText

func (c ApiChange) GetText(l Localizer) string

func (ApiChange) GetUncolorizedText

func (c ApiChange) GetUncolorizedText(l Localizer) string

func (ApiChange) IsBreaking

func (c ApiChange) IsBreaking() bool

func (ApiChange) MatchIgnore

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

func (ApiChange) MultiLineError

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

func (ApiChange) SingleLineError

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

type BackwardCompatibilityChecks []BackwardCompatibilityCheck

func GetAllChecks

func GetAllChecks() BackwardCompatibilityChecks

GetAllChecks gets all backward compatibility checks

type BackwardCompatibilityRule

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

type BackwardCompatibilityRules

type BackwardCompatibilityRules []BackwardCompatibilityRule

func GetAllRules

func GetAllRules() BackwardCompatibilityRules

func GetOptionalRules

func GetOptionalRules() BackwardCompatibilityRules

type Change

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

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 AddedRequestBodyCheck

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/Barterio/oasdiff/checker"
	"github.com/Barterio/oasdiff/diff"
	"github.com/Barterio/oasdiff/load"
	"github.com/getkin/kin-openapi/openapi3"
)

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]. This is a warning because some apps may return an error when receiving a parameter that they do not expect. It is recommended to deprecate the parameter first.

warning at ../data/openapi-test3.yaml, in API GET /api/{domain}/{project}/badges/security-score deleted the 'header' request parameter 'user' [request-parameter-removed]. This is a warning because some apps may return an error when receiving a parameter that they do not expect. It is recommended to deprecate the parameter first.

warning at ../data/openapi-test3.yaml, in API GET /api/{domain}/{project}/badges/security-score deleted the 'query' request parameter 'filter' [request-parameter-removed]. This is a warning because some apps may return an error when receiving a parameter that they do not expect. It is recommended to deprecate the parameter first.

func CheckBackwardCompatibilityUntilLevel

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

func NewRequestNonPathDefaultParameterCheck(diffReport *diff.Diff, operationsSources *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, l Localizer) (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 RequestBodyRemovedCheck

func RequestBodyRemovedCheck(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 RequestParameterDefaultValueChangedCheck

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

func RequestParameterDeprecationCheck

func RequestParameterDeprecationCheck(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 RequestParameterSunsetChangedCheck

func RequestParameterSunsetChangedCheck(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

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

func RequestPropertyAnyOfUpdatedCheck

func RequestPropertyAnyOfUpdatedCheck(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 RequestPropertyOneOfUpdatedCheck

func RequestPropertyOneOfUpdatedCheck(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 ResponseHeaderBecameOptionalCheck

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

func ResponseHeaderRemovedCheck

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

func ResponseMediaTypeEnumValueRemovedCheck

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

func ResponseMediaTypeNameUpdatedCheck

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

func ResponseMediaTypeUpdatedCheck

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

func ResponseNonSuccessStatusUpdatedCheck

func ResponseNonSuccessStatusUpdatedCheck(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 ResponsePropertyAllOfUpdatedCheck

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

func ResponsePropertyAnyOfUpdatedCheck

func ResponsePropertyAnyOfUpdatedCheck(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 ResponseSuccessStatusUpdatedCheck

func ResponseSuccessStatusUpdatedCheck(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 ColorMode

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

func NewColorMode

func NewColorMode(color string) (ColorMode, error)

type CommonChange

type CommonChange struct {
	Attributes map[string]any
}

func (CommonChange) GetAttributes

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

type ComponentChange

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

func (c ComponentChange) GetArgs() []any

func (ComponentChange) GetComment

func (c ComponentChange) GetComment(l Localizer) 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) GetSection

func (c ComponentChange) GetSection() string

func (ComponentChange) GetSource

func (c ComponentChange) GetSource() string

func (ComponentChange) GetSourceColumn

func (c ComponentChange) GetSourceColumn() int

func (ComponentChange) GetSourceColumnEnd

func (c ComponentChange) GetSourceColumnEnd() int

func (ComponentChange) GetSourceFile

func (c ComponentChange) GetSourceFile() string

func (ComponentChange) GetSourceLine

func (c ComponentChange) GetSourceLine() int

func (ComponentChange) GetSourceLineEnd

func (c ComponentChange) GetSourceLineEnd() int

func (ComponentChange) GetText

func (c ComponentChange) GetText(l Localizer) string

func (ComponentChange) GetUncolorizedText

func (c ComponentChange) GetUncolorizedText(l Localizer) string

func (ComponentChange) IsBreaking

func (c ComponentChange) IsBreaking() bool

func (ComponentChange) MatchIgnore

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

func (ComponentChange) MultiLineError

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

func (ComponentChange) SingleLineError

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

type Config

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

func NewConfig

func NewConfig(checks BackwardCompatibilityChecks) *Config

NewConfig creates a new configuration with default values.

func (*Config) WithAttributes

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

WithAttributes sets a list of attributes to be used.

func (*Config) WithChecks

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

WithChecks sets a list of checks to be used.

func (*Config) WithDeprecation

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

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

func (*Config) WithOptionalCheck

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

WithOptionalCheck adds a check to the list of optional checks.

func (*Config) WithOptionalChecks

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

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

func (*Config) WithSingleCheck

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

WithSingleCheck sets a single check to be used.

type Direction

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

type Level

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

func NewLevel

func NewLevel(level string) (Level, error)

func (Level) IsBreaking

func (level Level) IsBreaking() bool

func (Level) PrettyString

func (level Level) PrettyString() string

func (Level) String

func (level Level) String() string

func (Level) StringCond

func (level Level) StringCond(colorMode ColorMode) string

type Localizer

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

func NewDefaultLocalizer

func NewDefaultLocalizer() Localizer

func NewLocalizer

func NewLocalizer(locale string) Localizer

type Location

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

type SecurityChange

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

func (c SecurityChange) GetArgs() []any

func (SecurityChange) GetComment

func (c SecurityChange) GetComment(l Localizer) 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) GetSection

func (c SecurityChange) GetSection() string

func (SecurityChange) GetSource

func (c SecurityChange) GetSource() string

func (SecurityChange) GetSourceColumn

func (c SecurityChange) GetSourceColumn() int

func (SecurityChange) GetSourceColumnEnd

func (c SecurityChange) GetSourceColumnEnd() int

func (SecurityChange) GetSourceFile

func (c SecurityChange) GetSourceFile() string

func (SecurityChange) GetSourceLine

func (c SecurityChange) GetSourceLine() int

func (SecurityChange) GetSourceLineEnd

func (c SecurityChange) GetSourceLineEnd() int

func (SecurityChange) GetText

func (c SecurityChange) GetText(l Localizer) string

func (SecurityChange) GetUncolorizedText

func (c SecurityChange) GetUncolorizedText(l Localizer) string

func (SecurityChange) IsBreaking

func (c SecurityChange) IsBreaking() bool

func (SecurityChange) MatchIgnore

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

func (SecurityChange) MultiLineError

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

func (SecurityChange) SingleLineError

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