From c81233471f2f191c4047a2e25c9b2a5869ba2fc9 Mon Sep 17 00:00:00 2001 From: Bianca Date: Wed, 2 Aug 2023 18:06:34 +0100 Subject: [PATCH] Address first comment --- ...k-request-property-became-not-nuallable.go | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/checker/check-request-property-became-not-nuallable.go b/checker/check-request-property-became-not-nuallable.go index cf6bf8a2..cb26c9e9 100644 --- a/checker/check-request-property-became-not-nuallable.go +++ b/checker/check-request-property-became-not-nuallable.go @@ -34,26 +34,28 @@ func RequestPropertyBecameNotNullableCheck(diffReport *diff.Diff, operationsSour continue } - if mediaTypeDiff.SchemaDiff.NullableDiff != nil && mediaTypeDiff.SchemaDiff.NullableDiff.From == true { - result = append(result, ApiChange{ - Id: requestBodyBecameNotNullableId, - Level: ERR, - Text: config.i18n(requestBodyBecameNotNullableId), - Operation: operation, - Path: path, - Source: source, - OperationId: operationItem.Revision.OperationID, - }) - } else if mediaTypeDiff.SchemaDiff.NullableDiff != nil && mediaTypeDiff.SchemaDiff.NullableDiff.To == true { - result = append(result, ApiChange{ - Id: requestBodyBecameNullableId, - Level: INFO, - Text: config.i18n(requestBodyBecameNullableId), - Operation: operation, - Path: path, - Source: source, - OperationId: operationItem.Revision.OperationID, - }) + if mediaTypeDiff.SchemaDiff.NullableDiff != nil { + if mediaTypeDiff.SchemaDiff.NullableDiff.From == true { + result = append(result, ApiChange{ + Id: requestBodyBecameNotNullableId, + Level: ERR, + Text: config.i18n(requestBodyBecameNotNullableId), + Operation: operation, + Path: path, + Source: source, + OperationId: operationItem.Revision.OperationID, + }) + } else if mediaTypeDiff.SchemaDiff.NullableDiff.To == true { + result = append(result, ApiChange{ + Id: requestBodyBecameNullableId, + Level: INFO, + Text: config.i18n(requestBodyBecameNullableId), + Operation: operation, + Path: path, + Source: source, + OperationId: operationItem.Revision.OperationID, + }) + } } CheckModifiedPropertiesDiff(