Documentation ¶
Overview ¶
Package checker finds breaking-changes accoss openapi specifications.
Index ¶
- Constants
- func CheckAddedPropertiesDiff(schemaDiff *diff.SchemaDiff, ...)
- func CheckDeletedPropertiesDiff(schemaDiff *diff.SchemaDiff, ...)
- func CheckModifiedPropertiesDiff(schemaDiff *diff.SchemaDiff, ...)
- func GetAllRuleIds() []string
- func GetCheckLevels() map[string]Level
- func GetOptionalRuleIds() []string
- func GetSeverityLevels(source io.Reader) (map[string]Level, error)
- func GetSupportedColorValues() []string
- func IsDecreased(from interface{}, to interface{}) bool
- func IsDecreasedValue(diff *diff.ValueDiff) bool
- func IsIncreased(from interface{}, to interface{}) bool
- func IsIncreasedValue(diff *diff.ValueDiff) bool
- func ProcessSeverityLevels(file string) (map[string]Level, error)
- func SetPipedOutput(val *bool) *bool
- type Action
- type ApiChange
- func (c ApiChange) GetArgs() []any
- func (c ApiChange) GetComment(l Localizer) string
- func (c ApiChange) GetId() string
- func (c ApiChange) GetLevel() Level
- func (c ApiChange) GetOperation() string
- func (c ApiChange) GetOperationId() string
- func (c ApiChange) GetPath() string
- func (c ApiChange) GetSection() string
- func (c ApiChange) GetSource() string
- func (c ApiChange) GetSourceColumn() int
- func (c ApiChange) GetSourceColumnEnd() int
- func (c ApiChange) GetSourceFile() string
- func (c ApiChange) GetSourceLine() int
- func (c ApiChange) GetSourceLineEnd() int
- func (c ApiChange) GetText(l Localizer) string
- func (c ApiChange) GetUncolorizedText(l Localizer) string
- func (c ApiChange) IsBreaking() bool
- func (c ApiChange) MatchIgnore(ignorePath, ignoreLine string, l Localizer) bool
- func (c ApiChange) MultiLineError(l Localizer, colorMode ColorMode) string
- func (c ApiChange) SingleLineError(l Localizer, colorMode ColorMode) string
- type BackwardCompatibilityCheck
- type BackwardCompatibilityChecks
- type BackwardCompatibilityRule
- type BackwardCompatibilityRules
- type Change
- type Changes
- func APIAddedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func APIComponentsSchemaRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func APIComponentsSecurityUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func APIDeprecationCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func APIOperationIdUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func APIRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func APISecurityUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func APISunsetChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func APITagUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func AddedRequestBodyCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func CheckBackwardCompatibility(config *Config, diffReport *diff.Diff, ...) Changes
- func CheckBackwardCompatibilityUntilLevel(config *Config, diffReport *diff.Diff, ...) Changes
- func NewRequestNonPathDefaultParameterCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func NewRequestNonPathParameterCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func NewRequestPathParameterCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func NewRequiredRequestHeaderPropertyCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ProcessIgnoredBackwardCompatibilityErrors(level Level, errs Changes, ignoreFile string, l Localizer) (Changes, error)
- func RequestBodyBecameEnumCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestBodyEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestBodyMediaTypeChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestBodyRequiredUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestDiscriminatorUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestHeaderPropertyBecameEnumCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestHeaderPropertyBecameRequiredCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterBecameEnumCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterDefaultValueChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterEnumValueUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterMaxItemsUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterMaxLengthSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterMaxLengthUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterMaxSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterMaxUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterMinItemsSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterMinItemsUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterMinLengthUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterMinSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterMinUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterPatternAddedOrChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterRequiredValueUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterTypeChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestParameterXExtensibleEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyAllOfUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyAnyOfUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyBecameEnumCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyBecameNotNullableCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyDefaultValueChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyEnumValueUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyMaxDecreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyMaxLengthSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyMaxLengthUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyMaxSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyMinIncreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyMinItemsIncreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyMinItemsSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyMinLengthUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyMinSetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyOneOfUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyPatternUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyRequiredUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyTypeChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyWriteOnlyReadOnlyCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func RequestPropertyXExtensibleEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseDiscriminatorUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseHeaderBecameOptionalCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseHeaderRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseMediaTypeEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseMediaTypeUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseNonSuccessStatusUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseOptionalPropertyUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseOptionalPropertyWriteOnlyReadOnlyCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseParameterEnumValueRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePatternAddedOrChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyAllOfUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyAnyOfUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyBecameNullableCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyBecameOptionalCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyBecameRequiredCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyDefaultValueChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyEnumValueAddedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyMaxIncreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyMaxLengthIncreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyMaxLengthUnsetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyMinDecreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyMinItemsDecreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyMinItemsUnsetCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyMinLengthDecreasedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyOneOfUpdated(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponsePropertyTypeChangedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseRequiredPropertyUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseRequiredPropertyWriteOnlyReadOnlyCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- func ResponseSuccessStatusUpdatedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, ...) Changes
- type ColorMode
- type CommonChange
- type ComponentChange
- func (c ComponentChange) GetArgs() []any
- func (c ComponentChange) GetComment(l Localizer) string
- func (c ComponentChange) GetId() string
- func (c ComponentChange) GetLevel() Level
- func (ComponentChange) GetOperation() string
- func (ComponentChange) GetOperationId() string
- func (ComponentChange) GetPath() string
- func (c ComponentChange) GetSection() string
- func (c ComponentChange) GetSource() string
- func (c ComponentChange) GetSourceColumn() int
- func (c ComponentChange) GetSourceColumnEnd() int
- func (c ComponentChange) GetSourceFile() string
- func (c ComponentChange) GetSourceLine() int
- func (c ComponentChange) GetSourceLineEnd() int
- func (c ComponentChange) GetText(l Localizer) string
- func (c ComponentChange) GetUncolorizedText(l Localizer) string
- func (c ComponentChange) IsBreaking() bool
- func (c ComponentChange) MatchIgnore(ignorePath, ignoreLine string, l Localizer) bool
- func (c ComponentChange) MultiLineError(l Localizer, colorMode ColorMode) string
- func (c ComponentChange) SingleLineError(l Localizer, colorMode ColorMode) string
- type Config
- func (config *Config) WithAttributes(attributes []string) *Config
- func (config *Config) WithChecks(checks BackwardCompatibilityChecks) *Config
- func (config *Config) WithDeprecation(deprecationDaysBeta uint, deprecationDaysStable uint) *Config
- func (config *Config) WithOptionalCheck(id string) *Config
- func (config *Config) WithOptionalChecks(ids []string) *Config
- func (config *Config) WithSeverityLevels(severityLevels map[string]Level) *Config
- func (config *Config) WithSingleCheck(check BackwardCompatibilityCheck) *Config
- type Direction
- type Level
- type Localizer
- type Location
- type SecurityChange
- func (c SecurityChange) GetArgs() []any
- func (c SecurityChange) GetComment(l Localizer) string
- func (c SecurityChange) GetId() string
- func (c SecurityChange) GetLevel() Level
- func (r SecurityChange) GetOperation() string
- func (SecurityChange) GetOperationId() string
- func (SecurityChange) GetPath() string
- func (c SecurityChange) GetSection() string
- func (c SecurityChange) GetSource() string
- func (c SecurityChange) GetSourceColumn() int
- func (c SecurityChange) GetSourceColumnEnd() int
- func (c SecurityChange) GetSourceFile() string
- func (c SecurityChange) GetSourceLine() int
- func (c SecurityChange) GetSourceLineEnd() int
- func (c SecurityChange) GetText(l Localizer) string
- func (c SecurityChange) GetUncolorizedText(l Localizer) string
- func (c SecurityChange) IsBreaking() bool
- func (c SecurityChange) MatchIgnore(ignorePath, ignoreLine string, l Localizer) bool
- func (c SecurityChange) MultiLineError(l Localizer, colorMode ColorMode) string
- func (c SecurityChange) SingleLineError(l Localizer, colorMode ColorMode) string
Examples ¶
Constants ¶
const ( AddedRequiredRequestBodyId = "request-body-added-required" AddedOptionalRequestBodyId = "request-body-added-optional" )
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" )
const ( APIOperationIdRemovedId = "api-operation-id-removed" APIOperationIdAddId = "api-operation-id-added" )
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" )
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" )
const ( APISunsetDeletedId = "sunset-deleted" APISunsetDateChangedTooSmallId = "api-sunset-date-changed-too-small" )
const ( STABILITY_DRAFT = "draft" STABILITY_ALPHA = "alpha" STABILITY_BETA = "beta" STABILITY_STABLE = "stable" )
const ( APITagRemovedId = "api-tag-removed" APITagAddedId = "api-tag-added" )
const ( APISchemasRemovedId = "api-schema-removed" ComponentSchemas = "schemas" )
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" )
const ( NewRequiredRequestDefaultParameterToExistingPathId = "new-required-request-default-parameter-to-existing-path" NewOptionalRequestDefaultParameterToExistingPathId = "new-optional-request-default-parameter-to-existing-path" )
const ( NewRequiredRequestParameterId = "new-required-request-parameter" NewOptionalRequestParameterId = "new-optional-request-parameter" )
const ( RequestBodyMediaTypeAddedId = "request-body-media-type-added" RequestBodyMediaTypeRemovedId = "request-body-media-type-removed" )
const ( RequestBodyBecameOptionalId = "request-body-became-optional" RequestBodyBecameRequiredId = "request-body-became-required" )
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" )
const ( RequestParameterEnumValueAddedId = "request-parameter-enum-value-added" RequestParameterEnumValueRemovedId = "request-parameter-enum-value-removed" )
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" )
const ( RequestParameterBecomeRequiredId = "request-parameter-became-required" RequestParameterBecomeOptionalId = "request-parameter-became-optional" )
const ( RequestParameterDefaultValueChangedId = "request-parameter-default-value-changed" RequestParameterDefaultValueAddedId = "request-parameter-default-value-added" RequestParameterDefaultValueRemovedId = "request-parameter-default-value-removed" )
const ( RequestParameterMaxItemsIncreasedId = "request-parameter-max-items-increased" RequestParameterMaxItemsDecreasedId = "request-parameter-max-items-decreased" )
const ( RequestParameterMaxLengthDecreasedId = "request-parameter-max-length-decreased" RequestParameterMaxLengthIncreasedId = "request-parameter-max-length-increased" )
const ( RequestParameterMaxDecreasedId = "request-parameter-max-decreased" RequestParameterMaxIncreasedId = "request-parameter-max-increased" )
const ( RequestParameterMinItemsIncreasedId = "request-parameter-min-items-increased" RequestParameterMinItemsDecreasedId = "request-parameter-min-items-decreased" )
const ( RequestParameterMinLengthIncreasedId = "request-parameter-min-length-increased" RequestParameterMinLengthDecreasedId = "request-parameter-min-length-decreased" )
const ( RequestParameterMinIncreasedId = "request-parameter-min-increased" RequestParameterMinDecreasedId = "request-parameter-min-decreased" )
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" )
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" )
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" )
const ( RequestBodyBecomeNotNullableId = "request-body-became-not-nullable" RequestBodyBecomeNullableId = "request-body-became-nullable" RequestPropertyBecomeNotNullableId = "request-property-became-not-nullable" RequestPropertyBecomeNullableId = "request-property-became-nullable" )
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" )
const ( RequestPropertyEnumValueRemovedId = "request-property-enum-value-removed" RequestReadOnlyPropertyEnumValueRemovedId = "request-read-only-property-enum-value-removed" RequestPropertyEnumValueAddedId = "request-property-enum-value-added" )
const ( RequestBodyMaxLengthSetId = "request-body-max-length-set" RequestPropertyMaxLengthSetId = "request-property-max-length-set" )
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" )
const ( RequestBodyMaxSetId = "request-body-max-set" RequestPropertyMaxSetId = "request-property-max-set" )
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" )
const ( RequestBodyMinItemsIncreasedId = "request-body-min-items-increased" RequestPropertyMinItemsIncreasedId = "request-property-min-items-increased" )
const ( RequestBodyMinItemsSetId = "request-body-min-items-set" RequestPropertyMinItemsSetId = "request-property-min-items-set" )
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" )
const ( RequestBodyMinSetId = "request-body-min-set" RequestPropertyMinSetId = "request-property-min-set" )
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" )
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" )
const ( RequestPropertyPatternRemovedId = "request-property-pattern-removed" RequestPropertyPatternAddedId = "request-property-pattern-added" RequestPropertyPatternChangedId = "request-property-pattern-changed" RequestPropertyPatternGeneralizedId = "request-property-pattern-generalized" )
const ( RequestPropertyBecameRequiredId = "request-property-became-required" RequestPropertyBecameRequiredWithDefaultId = "request-property-became-required-with-default" RequestPropertyBecameOptionalId = "request-property-became-optional" )
const ( RequestBodyTypeGeneralizedId = "request-body-type-generalized" RequestBodyTypeChangedId = "request-body-type-changed" RequestPropertyTypeGeneralizedId = "request-property-type-generalized" RequestPropertyTypeChangedId = "request-property-type-changed" )
const ( RequestPropertyRemovedId = "request-property-removed" NewRequiredRequestPropertyId = "new-required-request-property" NewRequiredRequestPropertyWithDefaultId = "new-required-request-property-with-default" NewOptionalRequestPropertyId = "new-optional-request-property" )
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" )
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" )
const ( RequiredResponseHeaderRemovedId = "required-response-header-removed" OptionalResponseHeaderRemovedId = "optional-response-header-removed" )
const ( ResponseMediaTypeRemovedId = "response-media-type-removed" ResponseMediaTypeAddedId = "response-media-type-added" )
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" )
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" )
const ( ResponsePropertyPatternAddedId = "response-property-pattern-added" ResponsePropertyPatternChangedId = "response-property-pattern-changed" ResponsePropertyPatternRemovedId = "response-property-pattern-removed" )
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" )
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" )
const ( ResponsePropertyBecameNullableId = "response-property-became-nullable" ResponseBodyBecameNullableId = "response-body-became-nullable" )
const ( ResponsePropertyBecameOptionalId = "response-property-became-optional" ResponseWriteOnlyPropertyBecameOptionalId = "response-write-only-property-became-optional" )
const ( ResponsePropertyBecameRequiredId = "response-property-became-required" ResponseWriteOnlyPropertyBecameRequiredId = "response-write-only-property-became-required" )
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" )
const ( ResponsePropertyEnumValueAddedId = "response-property-enum-value-added" ResponseWriteOnlyPropertyEnumValueAddedId = "response-write-only-property-enum-value-added" )
const ( ResponseBodyMaxIncreasedId = "response-body-max-increased" ResponsePropertyMaxIncreasedId = "response-property-max-increased" )
const ( ResponseBodyMaxLengthIncreasedId = "response-body-max-length-increased" ResponsePropertyMaxLengthIncreasedId = "response-property-max-length-increased" )
const ( ResponseBodyMaxLengthUnsetId = "response-body-max-length-unset" ResponsePropertyMaxLengthUnsetId = "response-property-max-length-unset" )
const ( ResponseBodyMinDecreasedId = "response-body-min-decreased" ResponsePropertyMinDecreasedId = "response-property-min-decreased" )
const ( ResponseBodyMinItemsDecreasedId = "response-body-min-items-decreased" ResponsePropertyMinItemsDecreasedId = "response-property-min-items-decreased" )
const ( ResponseBodyMinItemsUnsetId = "response-body-min-items-unset" ResponsePropertyMinItemsUnsetId = "response-property-min-items-unset" )
const ( ResponseBodyMinLengthDecreasedId = "response-body-min-length-decreased" ResponsePropertyMinLengthDecreasedId = "response-property-min-length-decreased" )
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" )
const ( ResponseBodyTypeChangedId = "response-body-type-changed" ResponsePropertyTypeChangedId = "response-property-type-changed" )
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" )
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" )
const ( ResponseSuccessStatusRemovedId = "response-success-status-removed" ResponseNonSuccessStatusRemovedId = "response-non-success-status-removed" ResponseSuccessStatusAddedId = "response-success-status-added" ResponseNonSuccessStatusAddedId = "response-non-success-status-added" )
const ( DefaultBetaDeprecationDays = uint(0) DefaultStableDeprecationDays = uint(0) )
const (
APIStabilityDecreasedId = "api-stability-decreased"
)
const ComponentSecuritySchemes = "securitySchemes"
const (
EndpointAddedId = "endpoint-added"
)
const (
NewRequestPathParameterId = "new-request-path-parameter"
)
const (
NewRequiredRequestHeaderPropertyId = "new-required-request-header-property"
)
const (
RequestBodyBecameEnumId = "request-body-became-enum"
)
const (
RequestBodyEnumValueRemovedId = "request-body-enum-value-removed"
)
const (
RequestHeaderPropertyBecameEnumId = "request-header-property-became-enum"
)
const (
RequestHeaderPropertyBecameRequiredId = "request-header-property-became-required"
)
const (
RequestParameterBecameEnumId = "request-parameter-became-enum"
)
const (
RequestParameterMaxLengthSetId = "request-parameter-max-length-set"
)
const (
RequestParameterMaxSetId = "request-parameter-max-set"
)
const (
RequestParameterMinItemsSetId = "request-parameter-min-items-set"
)
const (
RequestParameterMinSetId = "request-parameter-min-set"
)
const (
RequestParameterRemovedId = "request-parameter-removed"
)
const (
RequestParameterXExtensibleEnumValueRemovedId = "request-parameter-x-extensible-enum-value-removed"
)
const (
RequestPropertyBecameEnumId = "request-property-became-enum"
)
const (
RequestPropertyXExtensibleEnumValueRemovedId = "request-property-x-extensible-enum-value-removed"
)
const (
ResponseHeaderBecameOptionalId = "response-header-became-optional"
)
const (
ResponseMediaTypeEnumValueRemovedId = "response-mediatype-enum-value-removed"
)
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
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
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 IsIncreased ¶
func IsIncreased(from interface{}, to interface{}) bool
func IsIncreasedValue ¶
func ProcessSeverityLevels ¶ added in v1.10.21
ProcessSeverityLevels reads a file with severity levels and returns a map of severity levels
func SetPipedOutput ¶ added in v1.9.7
Types ¶
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 (ApiChange) GetComment ¶ added in v1.6.0
func (ApiChange) GetOperation ¶ added in v1.6.0
func (ApiChange) GetOperationId ¶ added in v1.6.0
func (ApiChange) GetSection ¶ added in v1.10.0
func (ApiChange) GetSourceColumn ¶ added in v1.9.0
func (ApiChange) GetSourceColumnEnd ¶ added in v1.9.0
func (ApiChange) GetSourceFile ¶ added in v1.9.0
func (ApiChange) GetSourceLine ¶ added in v1.9.0
func (ApiChange) GetSourceLineEnd ¶ added in v1.9.0
func (ApiChange) GetUncolorizedText ¶ added in v1.10.0
func (ApiChange) IsBreaking ¶ added in v1.9.5
func (ApiChange) MatchIgnore ¶ added in v1.6.0
func (ApiChange) MultiLineError ¶ added in v1.10.0
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 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 APIComponentsSchemaRemovedCheck ¶ added in v1.5.14
func APIComponentsSecurityUpdatedCheck ¶ added in v1.5.20
func APIDeprecationCheck ¶
func APIOperationIdUpdatedCheck ¶ added in v1.5.19
func APIRemovedCheck ¶
func APISecurityUpdatedCheck ¶ added in v1.5.20
func APISunsetChangedCheck ¶
func APITagUpdatedCheck ¶ added in v1.5.19
func AddedRequestBodyCheck ¶ added in v1.10.15
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 NewRequestNonPathParameterCheck ¶ added in v1.5.18
func RequestBodyBecameEnumCheck ¶ added in v1.4.2
func RequestBodyEnumValueRemovedCheck ¶ added in v1.3.18
func RequestBodyMediaTypeChangedCheck ¶ added in v1.6.2
func RequestBodyRequiredUpdatedCheck ¶ added in v1.5.19
func RequestDiscriminatorUpdatedCheck ¶ added in v1.7.4
func RequestHeaderPropertyBecameEnumCheck ¶ added in v1.4.2
func RequestParameterBecameEnumCheck ¶ added in v1.4.2
func RequestParameterDefaultValueChangedCheck ¶ added in v1.9.0
func RequestParameterEnumValueUpdatedCheck ¶ added in v1.7.0
func RequestParameterMaxItemsUpdatedCheck ¶ added in v1.7.0
func RequestParameterMaxLengthUpdatedCheck ¶ added in v1.7.0
func RequestParameterMaxUpdatedCheck ¶ added in v1.7.0
func RequestParameterMinItemsUpdatedCheck ¶ added in v1.7.0
func RequestParameterMinLengthUpdatedCheck ¶ added in v1.7.0
func RequestParameterMinUpdatedCheck ¶ added in v1.7.0
func RequestParameterRequiredValueUpdatedCheck ¶ added in v1.5.17
func RequestPropertyAllOfUpdatedCheck ¶ added in v1.9.0
func RequestPropertyAnyOfUpdatedCheck ¶ added in v1.9.0
func RequestPropertyBecameEnumCheck ¶ added in v1.4.2
func RequestPropertyBecameNotNullableCheck ¶ added in v1.5.12
func RequestPropertyDefaultValueChangedCheck ¶ added in v1.7.3
func RequestPropertyEnumValueUpdatedCheck ¶ added in v1.7.1
func RequestPropertyMaxLengthUpdatedCheck ¶ added in v1.7.1
func RequestPropertyMinLengthUpdatedCheck ¶ added in v1.7.1
func RequestPropertyOneOfUpdatedCheck ¶ added in v1.9.0
func RequestPropertyPatternUpdatedCheck ¶ added in v1.6.6
func RequestPropertyRequiredUpdatedCheck ¶ added in v1.7.3
func RequestPropertyUpdatedCheck ¶ added in v1.7.3
func RequestPropertyWriteOnlyReadOnlyCheck ¶ added in v1.7.3
func ResponseDiscriminatorUpdatedCheck ¶ added in v1.7.4
func ResponseHeaderBecameOptionalCheck ¶ added in v1.9.0
func ResponseHeaderRemovedCheck ¶ added in v1.9.0
func ResponseMediaTypeEnumValueRemovedCheck ¶ added in v1.3.18
func ResponseMediaTypeUpdatedCheck ¶ added in v1.9.0
func ResponseNonSuccessStatusUpdatedCheck ¶ added in v1.9.0
func ResponseOptionalPropertyUpdatedCheck ¶ added in v1.5.20
func ResponseOptionalPropertyWriteOnlyReadOnlyCheck ¶ added in v1.6.2
func ResponseParameterEnumValueRemovedCheck ¶ added in v1.3.18
func ResponsePatternAddedOrChangedCheck ¶ added in v1.6.3
func ResponsePropertyAllOfUpdatedCheck ¶ added in v1.9.0
func ResponsePropertyAnyOfUpdatedCheck ¶ added in v1.9.0
func ResponsePropertyBecameNullableCheck ¶ added in v1.4.1
func ResponsePropertyBecameRequiredCheck ¶ added in v1.6.0
func ResponsePropertyDefaultValueChangedCheck ¶ added in v1.6.3
func ResponsePropertyOneOfUpdated ¶ added in v1.6.5
func ResponseRequiredPropertyUpdatedCheck ¶ added in v1.5.20
func ResponseRequiredPropertyWriteOnlyReadOnlyCheck ¶ added in v1.6.2
func ResponseSuccessStatusUpdatedCheck ¶ added in v1.9.0
func (Changes) GetLevelCount ¶ added in v1.6.0
func (Changes) HasLevelOrHigher ¶ added in v1.6.0
type CommonChange ¶ added in v1.10.22
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
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
WithDeprecation sets the number of days before sunset for deprecation warnings.
func (*Config) WithOptionalCheck ¶ added in v1.10.17
WithOptionalCheck adds a check to the list of optional checks.
func (*Config) WithOptionalChecks ¶ added in v1.10.17
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) WithSingleCheck ¶ added in v1.10.17
func (config *Config) WithSingleCheck(check BackwardCompatibilityCheck) *Config
WithSingleCheck sets a single check to be used.
type Level ¶ added in v1.5.15
type Level int
func (Level) IsBreaking ¶ added in v1.9.5
func (Level) PrettyString ¶ added in v1.6.0
func (Level) StringCond ¶ added in v1.10.0
type Localizer ¶ added in v1.7.6
func NewDefaultLocalizer ¶ added in v1.9.3
func NewDefaultLocalizer() Localizer
func NewLocalizer ¶ added in v1.7.6
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 ¶
- api_change.go
- change.go
- changes.go
- check_added_required_request_body.go
- check_api_added.go
- check_api_deprecation.go
- check_api_operation_id_updated.go
- check_api_removed.go
- check_api_security_updated.go
- check_api_sunset_changed.go
- check_api_tag_updated.go
- check_components_schemas_removed.go
- check_components_security_updated.go
- check_new_request_non_path_default_parameter.go
- check_new_request_non_path_parameter.go
- check_new_requried_request_header_property.go
- check_request_body_became_enum.go
- check_request_body_enum_deleted.go
- check_request_body_mediatype_updated.go
- check_request_body_required_value_updated.go
- check_request_discriminator_updated.go
- check_request_header_property_became_enum.go
- check_request_header_property_became_required.go
- check_request_parameter_became_enum.go
- check_request_parameter_enum_value_updated.go
- check_request_parameter_pattern_added_or_changed.go
- check_request_parameter_removed.go
- check_request_parameter_required_value_updated.go
- check_request_parameter_x_extensible_enum_value_removed.go
- check_request_parameters_default_value_changed.go
- check_request_parameters_max_items_updated.go
- check_request_parameters_max_length_set.go
- check_request_parameters_max_length_updated.go
- check_request_parameters_max_set.go
- check_request_parameters_max_updated.go
- check_request_parameters_min_items_set.go
- check_request_parameters_min_items_updated.go
- check_request_parameters_min_length_updated.go
- check_request_parameters_min_set.go
- check_request_parameters_min_updated.go
- check_request_parameters_type_changed.go
- check_request_path_parameter_added.go
- check_request_property_all_of_updated.go
- check_request_property_any_of_updated.go
- check_request_property_became_enum.go
- check_request_property_became_not_nuallable.go
- check_request_property_default_value_changed.go
- check_request_property_enum_value_updated.go
- check_request_property_max_length_set.go
- check_request_property_max_length_updated.go
- check_request_property_max_set.go
- check_request_property_max_updated.go
- check_request_property_min_items_increased.go
- check_request_property_min_items_set.go
- check_request_property_min_length_updated.go
- check_request_property_min_set.go
- check_request_property_min_updated.go
- check_request_property_one_of_updated.go
- check_request_property_pattern_added_or_changed.go
- check_request_property_required_updated.go
- check_request_property_type_changed.go
- check_request_property_updated.go
- check_request_property_write_only_read_only.go
- check_request_property_x_extensible_enum_value_removed.go
- check_response_discriminator_updated.go
- check_response_header_became_optional.go
- check_response_header_removed.go
- check_response_mediatype_enum_value_removed.go
- check_response_mediatype_updated.go
- check_response_optional_property_updated.go
- check_response_optional_property_write_only_read_only.go
- check_response_pattern_added_or_changed.go
- check_response_property_all_of_updated.go
- check_response_property_any_of_updated.go
- check_response_property_became_nuallable.go
- check_response_property_became_optional.go
- check_response_property_became_required.go
- check_response_property_default_value_changed.go
- check_response_property_enum_value_added.go
- check_response_property_enum_value_removed.go
- check_response_property_max_increased.go
- check_response_property_max_length_increased.go
- check_response_property_max_length_unset.go
- check_response_property_min_decreased.go
- check_response_property_min_items_decreased.go
- check_response_property_min_items_unset.go
- check_response_property_min_length_decreased.go
- check_response_property_one_of_updated.go
- check_response_property_type_changed.go
- check_response_required_property_updated.go
- check_response_required_property_write_only_read_only.go
- check_response_status_updated.go
- check_types.go
- checker.go
- checks-utils.go
- checks.go
- colorize.go
- component_change.go
- config.go
- deprecation.go
- doc.go
- ignore.go
- level.go
- localizer.go
- piped_output.go
- rules.go
- security_change.go
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. |