From 5eb5f9d4b76f67e4fa4d70f84b1c081c5d19870f Mon Sep 17 00:00:00 2001 From: Bianca Date: Fri, 28 Jul 2023 14:35:47 +0100 Subject: [PATCH] Address remaining comments --- checker/check-request-property-min-updated.go | 9 +++++---- checker/check-request-property-min-updated_test.go | 2 +- checker/localizations/localizations.go | 10 +++++----- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/checker/check-request-property-min-updated.go b/checker/check-request-property-min-updated.go index 17ed9e69..08f28e81 100644 --- a/checker/check-request-property-min-updated.go +++ b/checker/check-request-property-min-updated.go @@ -64,11 +64,12 @@ func RequestPropertyMinIncreasedCheck(diffReport *diff.Diff, operationsSources * minDiff.To == nil { return } - level := ERR - if propertyDiff.Revision.Value.ReadOnly { - level = INFO - } if IsIncreasedValue(minDiff) { + level := ERR + if propertyDiff.Revision.Value.ReadOnly { + level = INFO + } + result = append(result, ApiChange{ Id: "request-property-min-increased", Level: level, diff --git a/checker/check-request-property-min-updated_test.go b/checker/check-request-property-min-updated_test.go index 493e34ed..266b6d3a 100644 --- a/checker/check-request-property-min-updated_test.go +++ b/checker/check-request-property-min-updated_test.go @@ -45,7 +45,7 @@ func TestRequestPropertyMinDecreasedCheck(t *testing.T) { require.Len(t, errs, 1) require.Equal(t, checker.ApiChange{ Id: "request-property-min-decreased", - Text: "the 'age' request property's min was decreased to '10.00'", + Text: "the 'age' request property's min was decreased from '15.00' to '10.00'", Level: checker.INFO, Operation: "POST", Path: "/pets", diff --git a/checker/localizations/localizations.go b/checker/localizations/localizations.go index 8bd12cfd..526989a2 100644 --- a/checker/localizations/localizations.go +++ b/checker/localizations/localizations.go @@ -1,6 +1,6 @@ // Code generated by go-localize; DO NOT EDIT. // This file was generated by robots at -// 2023-07-28 14:03:02.386832 +0100 IST m=+0.005766042 +// 2023-07-28 14:35:07.07033 +0100 IST m=+0.005076168 package localizations @@ -74,9 +74,9 @@ var localizations = map[string]string{ "en.messages.request-body-max-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", "en.messages.request-body-media-type-added": "added the media type %s to the request body", "en.messages.request-body-media-type-removed": "removed the media type %s from the request body", - "en.messages.request-body-min-decreased": "the request's body min was decreased to %s", + "en.messages.request-body-min-decreased": "the request's body min was decreased to from %s to %s", "en.messages.request-body-min-increased": "the request's body min was increased to %s", - "en.messages.request-body-min-items-decreased": "the request's body minItems was decreased to %s", + "en.messages.request-body-min-items-decreased": "the request's body minItems was decreased from %s to %s", "en.messages.request-body-min-items-increased": "the request's body minItems was increased to %s", "en.messages.request-body-min-items-set": "the request's body minItems was set to %s", "en.messages.request-body-min-items-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", @@ -138,9 +138,9 @@ var localizations = map[string]string{ "en.messages.request-property-max-length-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", "en.messages.request-property-max-set": "the %s request property's max was set to %s", "en.messages.request-property-max-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.", - "en.messages.request-property-min-decreased": "the %s request property's min was decreased to %s", + "en.messages.request-property-min-decreased": "the %s request property's min was decreased from %s to %s", "en.messages.request-property-min-increased": "the %s request property's min was increased to %s", - "en.messages.request-property-min-items-decreased": "the %s request property's minItems was decreased to %s", + "en.messages.request-property-min-items-decreased": "the %s request property's minItems was decreased from %s to %s", "en.messages.request-property-min-items-increased": "the %s request property's minItems was increased to %s", "en.messages.request-property-min-items-set": "the %s request property's minItems was set to %s", "en.messages.request-property-min-items-set-comment": "This is a warning because sometimes it is required to be set. But good clients should be checked to support this restriction before such change in specification.",