Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue267: basic check for removal of schemas #270

Merged
merged 13 commits into from
Jun 1, 2023
28 changes: 28 additions & 0 deletions checker/check-components-schemas-removed.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package checker

import (
"github.com/tufin/oasdiff/diff"
)

const (
apiSchemasRemovedCheckId = "api-model-removed"
)

func APIOperationSchemasRemovedCheck(diffReport *diff.Diff, operationsSources *diff.OperationsSourcesMap, config BackwardCompatibilityCheckConfig) []BackwardCompatibilityError {
result := make([]BackwardCompatibilityError, 0)
if diffReport.ComponentsDiff.SchemasDiff == nil {
return result
}

for _, pathItem := range diffReport.ComponentsDiff.SchemasDiff.Deleted {
result = append(result, BackwardCompatibilityError{
Id: apiSchemasRemovedCheckId,
Level: ERR,
Text: config.i18n(apiSchemasRemovedCheckId),
Operation: "",
wtrocki marked this conversation as resolved.
Show resolved Hide resolved
Path: pathItem,
Source: "",
})
}
return result
}