From d20ec7e0f307fdb91c0b798ec0d69e8afbe3cb46 Mon Sep 17 00:00:00 2001 From: jkalbacher Date: Tue, 10 Dec 2024 08:25:44 -0800 Subject: [PATCH 1/2] fix: exclude 429 from linter --- isp-rules.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/isp-rules.yaml b/isp-rules.yaml index 2e9f382..43736d5 100644 --- a/isp-rules.yaml +++ b/isp-rules.yaml @@ -140,8 +140,9 @@ rules: # Errors must include a `detail` field error-detail: severity: error - description: Errors must be problem+JSON and include a "detail" field - given: $..responses.[?(@property.toString().startsWith("4") || @property.toString() === "500")] + # 429 returns from the API Gateway, so we exclude it + description: Errors must be problem+JSON or text/plain and include a "detail" field + given: $..responses.[?(@property.toString().startsWith("4") || @property.toString() === "500") && @property.toString() != "429"] then: - field: content function: truthy From 53e66918f706a2b6704d2e6874f23d2ebfdbca6c Mon Sep 17 00:00:00 2001 From: jkalbacher Date: Tue, 10 Dec 2024 09:06:06 -0800 Subject: [PATCH 2/2] wrap entire qualifying statement for error description --- isp-rules.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isp-rules.yaml b/isp-rules.yaml index 43736d5..943a257 100644 --- a/isp-rules.yaml +++ b/isp-rules.yaml @@ -142,7 +142,7 @@ rules: severity: error # 429 returns from the API Gateway, so we exclude it description: Errors must be problem+JSON or text/plain and include a "detail" field - given: $..responses.[?(@property.toString().startsWith("4") || @property.toString() === "500") && @property.toString() != "429"] + given: $..responses.[?((@property.toString().startsWith("4") || @property.toString() === "500") && @property.toString() != "429")] then: - field: content function: truthy