From 372d11c93b930783b00878c155259814b49f56ba Mon Sep 17 00:00:00 2001 From: Yeliz Henden Date: Thu, 20 Mar 2025 14:20:25 +0000 Subject: [PATCH 1/2] Fix: Degrade severity level for IPA-125 rules --- tools/spectral/ipa/rulesets/IPA-125.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/spectral/ipa/rulesets/IPA-125.yaml b/tools/spectral/ipa/rulesets/IPA-125.yaml index e48c385311..6c87d7fecf 100644 --- a/tools/spectral/ipa/rulesets/IPA-125.yaml +++ b/tools/spectral/ipa/rulesets/IPA-125.yaml @@ -36,7 +36,7 @@ rules: This is valid because there are exactly 2 mappings for 2 oneOf references, and all values match. message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-125-oneOf-must-have-discriminator' - severity: error + severity: warn given: '$.components.schemas[*]' then: function: 'IPA125OneOfMustHaveDiscriminator' @@ -84,7 +84,7 @@ rules: ``` message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-125-oneOf-no-base-types' - severity: error + severity: warn given: '$.components.schemas[*]' then: function: 'IPA125OneOfNoBaseTypes' From 04418c1192eadc1ea1a78b8b6eec9e707b607035 Mon Sep 17 00:00:00 2001 From: Yeliz Henden Date: Thu, 20 Mar 2025 14:22:12 +0000 Subject: [PATCH 2/2] ipa docs fix --- tools/spectral/ipa/rulesets/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/spectral/ipa/rulesets/README.md b/tools/spectral/ipa/rulesets/README.md index 11cfca9038..aa711c6dc5 100644 --- a/tools/spectral/ipa/rulesets/README.md +++ b/tools/spectral/ipa/rulesets/README.md @@ -508,7 +508,7 @@ Rules are based on [http://go/ipa/IPA-125](http://go/ipa/IPA-125). #### xgen-IPA-125-oneOf-must-have-discriminator - ![error](https://img.shields.io/badge/error-red) + ![warn](https://img.shields.io/badge/warning-yellow) Each oneOf property must include a discriminator property to define the exact type. ##### Implementation details @@ -538,7 +538,7 @@ Rule checks for the following conditions: #### xgen-IPA-125-oneOf-no-base-types - ![error](https://img.shields.io/badge/error-red) + ![warn](https://img.shields.io/badge/warning-yellow) API producers should not use oneOf with base types like integer, string, boolean, or number. ##### Implementation details