From 9fd208549440296be5eeab258a0ff5a2496fd9e1 Mon Sep 17 00:00:00 2001 From: "mongodb-sage-bot[bot]" <247496174+mongodb-sage-bot[bot]@users.noreply.github.com> Date: Thu, 27 Aug 2026 17:31:27 +0000 Subject: [PATCH 1/5] CLOUDP-439595: add IPA-111 validation rules ## Proposed changes Add three new Spectral validation rules enforcing lintable IPA-111 (Default Values) constraints to the IPA Validation Framework: - `xgen-IPA-111-optional-fields-no-default`: optional (non-required) fields must not define a default value. Boolean fields are delegated to the boolean rule below, and fields marked with the new `x-xgen-server-computed-when-client-omitted` extension are exempt. - `xgen-IPA-111-effective-fields-read-only`: effective-value fields (property names prefixed with `effective`) must be `readOnly: true` and must not appear in request schemas. - `xgen-IPA-111-optional-boolean-fields-default-false`: optional boolean fields must default to `false`. Also adds the `IPA-111.yaml` ruleset, registers it in `ipa-spectral.yaml`, regenerates the ruleset README, and introduces shared helpers `isRequiredProperty` (schemaUtils) and `hasServerComputedWhenClientOmittedExtension` (extensions). _Jira ticket:_ CLOUDP-439595 ## Checklist - [ ] I have signed the [MongoDB CLA](https://www.mongodb.com/legal/contributor-agreement) - [x] I have added tests that prove my fix is effective or that my feature works ### Changes to Spectral - [x] I have read the [README](../tools/spectral/README.md) file for Spectral Updates --- .../IPA111EffectiveFieldsReadOnly.test.js | 146 +++++++++++++ ...1OptionalBooleanFieldsDefaultFalse.test.js | 193 +++++++++++++++++ .../IPA111OptionalFieldsNoDefault.test.js | 194 ++++++++++++++++++ tools/spectral/ipa/ipa-spectral.yaml | 1 + tools/spectral/ipa/rulesets/IPA-111.yaml | 66 ++++++ tools/spectral/ipa/rulesets/README.md | 39 ++++ .../IPA111EffectiveFieldsReadOnly.js | 41 ++++ ...IPA111OptionalBooleanFieldsDefaultFalse.js | 36 ++++ .../IPA111OptionalFieldsNoDefault.js | 48 +++++ .../rulesets/functions/utils/extensions.js | 12 ++ .../rulesets/functions/utils/schemaUtils.js | 18 ++ 11 files changed, 794 insertions(+) create mode 100644 tools/spectral/ipa/__tests__/IPA111EffectiveFieldsReadOnly.test.js create mode 100644 tools/spectral/ipa/__tests__/IPA111OptionalBooleanFieldsDefaultFalse.test.js create mode 100644 tools/spectral/ipa/__tests__/IPA111OptionalFieldsNoDefault.test.js create mode 100644 tools/spectral/ipa/rulesets/IPA-111.yaml create mode 100644 tools/spectral/ipa/rulesets/functions/IPA111EffectiveFieldsReadOnly.js create mode 100644 tools/spectral/ipa/rulesets/functions/IPA111OptionalBooleanFieldsDefaultFalse.js create mode 100644 tools/spectral/ipa/rulesets/functions/IPA111OptionalFieldsNoDefault.js diff --git a/tools/spectral/ipa/__tests__/IPA111EffectiveFieldsReadOnly.test.js b/tools/spectral/ipa/__tests__/IPA111EffectiveFieldsReadOnly.test.js new file mode 100644 index 00000000000..ba2b5f3820b --- /dev/null +++ b/tools/spectral/ipa/__tests__/IPA111EffectiveFieldsReadOnly.test.js @@ -0,0 +1,146 @@ +import testRule from './__helpers__/testRule'; +import { DiagnosticSeverity } from '@stoplight/types'; + +testRule('xgen-IPA-111-effective-fields-read-only', [ + { + name: 'valid effective field with readOnly: true', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + effectiveState: { type: 'string', readOnly: true }, + }, + }, + }, + }, + }, + errors: [], + }, + { + name: 'valid non-effective field without readOnly', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + state: { type: 'string' }, + effective: { type: 'string' }, + }, + }, + }, + }, + }, + errors: [], + }, + { + name: 'invalid effective field without readOnly', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + effectiveState: { type: 'string' }, + }, + }, + }, + }, + }, + errors: [ + { + code: 'xgen-IPA-111-effective-fields-read-only', + message: 'Effective-value fields must be marked as readOnly: true.', + path: ['components', 'schemas', 'Schema', 'properties', 'effectiveState'], + severity: DiagnosticSeverity.Error, + }, + ], + }, + { + name: 'invalid effective field with readOnly: false', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + effectiveState: { type: 'string', readOnly: false }, + }, + }, + }, + }, + }, + errors: [ + { + code: 'xgen-IPA-111-effective-fields-read-only', + message: 'Effective-value fields must be marked as readOnly: true.', + path: ['components', 'schemas', 'Schema', 'properties', 'effectiveState'], + severity: DiagnosticSeverity.Error, + }, + ], + }, + { + name: 'invalid effective field in request schema', + document: { + paths: { + '/resources': { + post: { + requestBody: { + content: { + 'application/vnd.atlas.2024-01-01+json': { + schema: { + type: 'object', + properties: { + effectiveState: { type: 'string', readOnly: true }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + errors: [ + { + code: 'xgen-IPA-111-effective-fields-read-only', + message: 'Effective-value fields represent server-computed state and must not appear in request schemas.', + path: [ + 'paths', + '/resources', + 'post', + 'requestBody', + 'content', + 'application/vnd.atlas.2024-01-01+json', + 'schema', + 'properties', + 'effectiveState', + ], + severity: DiagnosticSeverity.Error, + }, + ], + }, + { + name: 'invalid effective field without readOnly - exception', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + effectiveState: { + type: 'string', + 'x-xgen-IPA-exception': { + 'xgen-IPA-111-effective-fields-read-only': 'Reason', + }, + }, + }, + }, + }, + }, + }, + errors: [], + }, +]); diff --git a/tools/spectral/ipa/__tests__/IPA111OptionalBooleanFieldsDefaultFalse.test.js b/tools/spectral/ipa/__tests__/IPA111OptionalBooleanFieldsDefaultFalse.test.js new file mode 100644 index 00000000000..4512d78d522 --- /dev/null +++ b/tools/spectral/ipa/__tests__/IPA111OptionalBooleanFieldsDefaultFalse.test.js @@ -0,0 +1,193 @@ +import testRule from './__helpers__/testRule'; +import { DiagnosticSeverity } from '@stoplight/types'; + +testRule('xgen-IPA-111-optional-boolean-fields-default-false', [ + { + name: 'valid optional boolean field with default false', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + enabled: { type: 'boolean', default: false }, + }, + }, + }, + }, + }, + errors: [], + }, + { + name: 'valid required boolean field without default', + document: { + components: { + schemas: { + Schema: { + type: 'object', + required: ['enabled'], + properties: { + enabled: { type: 'boolean' }, + }, + }, + }, + }, + }, + errors: [], + }, + { + name: 'valid non-boolean field without default', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + name: { type: 'string' }, + }, + }, + }, + }, + }, + errors: [], + }, + { + name: 'invalid optional boolean field without default', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + enabled: { type: 'boolean' }, + }, + }, + }, + }, + }, + errors: [ + { + code: 'xgen-IPA-111-optional-boolean-fields-default-false', + message: 'Optional boolean fields must default to false.', + path: ['components', 'schemas', 'Schema', 'properties', 'enabled'], + severity: DiagnosticSeverity.Error, + }, + ], + }, + { + name: 'invalid optional boolean field with default true', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + enabled: { type: 'boolean', default: true }, + }, + }, + }, + }, + }, + errors: [ + { + code: 'xgen-IPA-111-optional-boolean-fields-default-false', + message: 'Optional boolean fields must default to false.', + path: ['components', 'schemas', 'Schema', 'properties', 'enabled'], + severity: DiagnosticSeverity.Error, + }, + ], + }, + { + name: 'invalid optional boolean field in request and response', + document: { + paths: { + '/resources': { + post: { + requestBody: { + content: { + 'application/vnd.atlas.2024-01-01+json': { + schema: { + type: 'object', + properties: { + paused: { type: 'boolean' }, + }, + }, + }, + }, + }, + responses: { + 201: { + content: { + 'application/vnd.atlas.2024-01-01+json': { + schema: { + type: 'object', + properties: { + hidden: { type: 'boolean', default: true }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + errors: [ + { + code: 'xgen-IPA-111-optional-boolean-fields-default-false', + message: 'Optional boolean fields must default to false.', + path: [ + 'paths', + '/resources', + 'post', + 'requestBody', + 'content', + 'application/vnd.atlas.2024-01-01+json', + 'schema', + 'properties', + 'paused', + ], + severity: DiagnosticSeverity.Error, + }, + { + code: 'xgen-IPA-111-optional-boolean-fields-default-false', + message: 'Optional boolean fields must default to false.', + path: [ + 'paths', + '/resources', + 'post', + 'responses', + '201', + 'content', + 'application/vnd.atlas.2024-01-01+json', + 'schema', + 'properties', + 'hidden', + ], + severity: DiagnosticSeverity.Error, + }, + ], + }, + { + name: 'invalid optional boolean field without default - exception', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + enabled: { + type: 'boolean', + 'x-xgen-IPA-exception': { + 'xgen-IPA-111-optional-boolean-fields-default-false': 'Reason', + }, + }, + }, + }, + }, + }, + }, + errors: [], + }, +]); diff --git a/tools/spectral/ipa/__tests__/IPA111OptionalFieldsNoDefault.test.js b/tools/spectral/ipa/__tests__/IPA111OptionalFieldsNoDefault.test.js new file mode 100644 index 00000000000..fb320c0f1b1 --- /dev/null +++ b/tools/spectral/ipa/__tests__/IPA111OptionalFieldsNoDefault.test.js @@ -0,0 +1,194 @@ +import testRule from './__helpers__/testRule'; +import { DiagnosticSeverity } from '@stoplight/types'; + +testRule('xgen-IPA-111-optional-fields-no-default', [ + { + name: 'valid optional field without default', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + name: { type: 'string' }, + }, + }, + }, + }, + }, + errors: [], + }, + { + name: 'valid required field with default', + document: { + components: { + schemas: { + Schema: { + type: 'object', + required: ['name'], + properties: { + name: { type: 'string', default: 'value' }, + }, + }, + }, + }, + }, + errors: [], + }, + { + name: 'valid optional field with default and server-computed extension', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + name: { + type: 'string', + default: 'value', + 'x-xgen-server-computed-when-client-omitted': true, + }, + }, + }, + }, + }, + }, + errors: [], + }, + { + name: 'valid optional boolean field with default (handled by other rule)', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + enabled: { type: 'boolean', default: true }, + }, + }, + }, + }, + }, + errors: [], + }, + { + name: 'invalid optional field with default', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + name: { type: 'string', default: 'value' }, + }, + }, + }, + }, + }, + errors: [ + { + code: 'xgen-IPA-111-optional-fields-no-default', + message: + 'Optional fields must not define a default value. Remove the default or mark the field with x-xgen-server-computed-when-client-omitted if the server computes it when omitted.', + path: ['components', 'schemas', 'Schema', 'properties', 'name'], + severity: DiagnosticSeverity.Error, + }, + ], + }, + { + name: 'invalid optional field with default in request and response', + document: { + paths: { + '/resources': { + post: { + requestBody: { + content: { + 'application/vnd.atlas.2024-01-01+json': { + schema: { + type: 'object', + properties: { + size: { type: 'integer', default: 5 }, + }, + }, + }, + }, + }, + responses: { + 201: { + content: { + 'application/vnd.atlas.2024-01-01+json': { + schema: { + type: 'object', + properties: { + region: { type: 'string', default: 'US_EAST' }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + errors: [ + { + code: 'xgen-IPA-111-optional-fields-no-default', + message: + 'Optional fields must not define a default value. Remove the default or mark the field with x-xgen-server-computed-when-client-omitted if the server computes it when omitted.', + path: [ + 'paths', + '/resources', + 'post', + 'requestBody', + 'content', + 'application/vnd.atlas.2024-01-01+json', + 'schema', + 'properties', + 'size', + ], + severity: DiagnosticSeverity.Error, + }, + { + code: 'xgen-IPA-111-optional-fields-no-default', + message: + 'Optional fields must not define a default value. Remove the default or mark the field with x-xgen-server-computed-when-client-omitted if the server computes it when omitted.', + path: [ + 'paths', + '/resources', + 'post', + 'responses', + '201', + 'content', + 'application/vnd.atlas.2024-01-01+json', + 'schema', + 'properties', + 'region', + ], + severity: DiagnosticSeverity.Error, + }, + ], + }, + { + name: 'invalid optional field with default - exception', + document: { + components: { + schemas: { + Schema: { + type: 'object', + properties: { + name: { + type: 'string', + default: 'value', + 'x-xgen-IPA-exception': { + 'xgen-IPA-111-optional-fields-no-default': 'Reason', + }, + }, + }, + }, + }, + }, + }, + errors: [], + }, +]); diff --git a/tools/spectral/ipa/ipa-spectral.yaml b/tools/spectral/ipa/ipa-spectral.yaml index e15fff8b6fd..9657ce17a8b 100644 --- a/tools/spectral/ipa/ipa-spectral.yaml +++ b/tools/spectral/ipa/ipa-spectral.yaml @@ -8,6 +8,7 @@ extends: - ./rulesets/IPA-108.yaml - ./rulesets/IPA-109.yaml - ./rulesets/IPA-110.yaml + - ./rulesets/IPA-111.yaml - ./rulesets/IPA-112.yaml - ./rulesets/IPA-113.yaml - ./rulesets/IPA-114.yaml diff --git a/tools/spectral/ipa/rulesets/IPA-111.yaml b/tools/spectral/ipa/rulesets/IPA-111.yaml new file mode 100644 index 00000000000..c3f3ffece69 --- /dev/null +++ b/tools/spectral/ipa/rulesets/IPA-111.yaml @@ -0,0 +1,66 @@ +# IPA-111: Default Values +# https://mongodb.github.io/ipa/111 + +functions: + - IPA111OptionalFieldsNoDefault + - IPA111EffectiveFieldsReadOnly + - IPA111OptionalBooleanFieldsDefaultFalse + +rules: + xgen-IPA-111-optional-fields-no-default: + description: | + Optional fields must not define a default value. + + ##### Implementation details + Rule checks for the following conditions: + - Applies to optional (non-required) schema properties in components, request bodies and responses + - Boolean fields are exempt (covered by xgen-IPA-111-optional-boolean-fields-default-false) + - Fields marked with the x-xgen-server-computed-when-client-omitted extension are exempt + - Fails if the field defines a default value + message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-111-optional-fields-no-default' + severity: error + resolved: false + given: + - '$.components.schemas..properties' + - '$.paths..requestBody.content[?(@property.match(/json$/i))].schema..properties' + - '$.paths..responses..content[?(@property.match(/json$/i))].schema..properties' + then: + field: '@key' + function: 'IPA111OptionalFieldsNoDefault' + xgen-IPA-111-effective-fields-read-only: + description: | + Effective-value fields must be marked as readOnly: true and must not appear in request schemas. + + ##### Implementation details + Rule checks for the following conditions: + - Applies to schema properties whose name starts with the "effective" prefix + - Fails if the field appears in a request schema + - Fails if the field is not marked with readOnly: true + message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-111-effective-fields-read-only' + severity: error + resolved: false + given: + - '$.components.schemas..properties' + - '$.paths..requestBody.content[?(@property.match(/json$/i))].schema..properties' + - '$.paths..responses..content[?(@property.match(/json$/i))].schema..properties' + then: + field: '@key' + function: 'IPA111EffectiveFieldsReadOnly' + xgen-IPA-111-optional-boolean-fields-default-false: + description: | + Optional boolean fields must default to false. + + ##### Implementation details + Rule checks for the following conditions: + - Applies to optional (non-required) boolean schema properties in components, request bodies and responses + - Fails if the field does not define a default value of false + message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-111-optional-boolean-fields-default-false' + severity: error + resolved: false + given: + - '$.components.schemas..properties' + - '$.paths..requestBody.content[?(@property.match(/json$/i))].schema..properties' + - '$.paths..responses..content[?(@property.match(/json$/i))].schema..properties' + then: + field: '@key' + function: 'IPA111OptionalBooleanFieldsDefaultFalse' diff --git a/tools/spectral/ipa/rulesets/README.md b/tools/spectral/ipa/rulesets/README.md index 3053dea3fb5..64de5a8d9ef 100644 --- a/tools/spectral/ipa/rulesets/README.md +++ b/tools/spectral/ipa/rulesets/README.md @@ -776,6 +776,45 @@ Rule checks for the following conditions: +### IPA-111 + +Rules are based on [https://mongodb.github.io/ipa/111](https://mongodb.github.io/ipa/111). + +#### xgen-IPA-111-optional-fields-no-default + + ![error](https://img.shields.io/badge/error-red) +Optional fields must not define a default value. + +##### Implementation details +Rule checks for the following conditions: + - Applies to optional (non-required) schema properties in components, request bodies and responses + - Boolean fields are exempt (covered by xgen-IPA-111-optional-boolean-fields-default-false) + - Fields marked with the x-xgen-server-computed-when-client-omitted extension are exempt + - Fails if the field defines a default value + +#### xgen-IPA-111-effective-fields-read-only + + ![error](https://img.shields.io/badge/error-red) +Effective-value fields must be marked as readOnly: true and must not appear in request schemas. + +##### Implementation details +Rule checks for the following conditions: + - Applies to schema properties whose name starts with the "effective" prefix + - Fails if the field appears in a request schema + - Fails if the field is not marked with readOnly: true + +#### xgen-IPA-111-optional-boolean-fields-default-false + + ![error](https://img.shields.io/badge/error-red) +Optional boolean fields must default to false. + +##### Implementation details +Rule checks for the following conditions: + - Applies to optional (non-required) boolean schema properties in components, request bodies and responses + - Fails if the field does not define a default value of false + + + ### IPA-112 Rules are based on [https://mongodb.github.io/ipa/112](https://mongodb.github.io/ipa/112). diff --git a/tools/spectral/ipa/rulesets/functions/IPA111EffectiveFieldsReadOnly.js b/tools/spectral/ipa/rulesets/functions/IPA111EffectiveFieldsReadOnly.js new file mode 100644 index 00000000000..365b9283c5d --- /dev/null +++ b/tools/spectral/ipa/rulesets/functions/IPA111EffectiveFieldsReadOnly.js @@ -0,0 +1,41 @@ +import { evaluateAndCollectAdoptionStatus, handleInternalError } from './utils/collectionUtils.js'; +import { pathIsForRequestVersion, resolveObject } from './utils/componentUtils.js'; + +const EFFECTIVE_PREFIX_REGEX = /^effective[A-Z]/; +const REQUEST_ERROR_MESSAGE = + 'Effective-value fields represent server-computed state and must not appear in request schemas.'; +const READ_ONLY_ERROR_MESSAGE = 'Effective-value fields must be marked as readOnly: true.'; + +export default (input, _, { path, documentInventory, rule }) => { + const ruleName = rule.name; + const oas = documentInventory.unresolved; + const property = resolveObject(oas, path); + + // Skip schema references ($ref): + // Referenced schemas are validated separately to prevent duplicate violations + if (!property) { + return; + } + + // The rule only applies to effective-value fields, identified by the "effective" prefix + if (!EFFECTIVE_PREFIX_REGEX.test(input)) { + return; + } + + const errors = checkViolationsAndReturnErrors(property, path, ruleName); + return evaluateAndCollectAdoptionStatus(errors, ruleName, property, path); +}; + +function checkViolationsAndReturnErrors(property, path, ruleName) { + try { + if (pathIsForRequestVersion(path)) { + return [{ path, message: REQUEST_ERROR_MESSAGE }]; + } + if (property.readOnly !== true) { + return [{ path, message: READ_ONLY_ERROR_MESSAGE }]; + } + return []; + } catch (e) { + return handleInternalError(ruleName, path, e); + } +} diff --git a/tools/spectral/ipa/rulesets/functions/IPA111OptionalBooleanFieldsDefaultFalse.js b/tools/spectral/ipa/rulesets/functions/IPA111OptionalBooleanFieldsDefaultFalse.js new file mode 100644 index 00000000000..b694c63cad1 --- /dev/null +++ b/tools/spectral/ipa/rulesets/functions/IPA111OptionalBooleanFieldsDefaultFalse.js @@ -0,0 +1,36 @@ +import { evaluateAndCollectAdoptionStatus, handleInternalError } from './utils/collectionUtils.js'; +import { resolveObject } from './utils/componentUtils.js'; +import { isRequiredProperty } from './utils/schemaUtils.js'; + +const ERROR_MESSAGE = 'Optional boolean fields must default to false.'; + +export default (input, _, { path, documentInventory, rule }) => { + const ruleName = rule.name; + const oas = documentInventory.unresolved; + const property = resolveObject(oas, path); + + // Skip schema references ($ref) and non-boolean fields: + // Referenced schemas are validated separately to prevent duplicate violations + if (!property || property.type !== 'boolean') { + return; + } + + // The rule only applies to optional fields + if (isRequiredProperty(oas, path)) { + return; + } + + const errors = checkViolationsAndReturnErrors(property, path, ruleName); + return evaluateAndCollectAdoptionStatus(errors, ruleName, property, path); +}; + +function checkViolationsAndReturnErrors(property, path, ruleName) { + try { + if (property.default !== false) { + return [{ path, message: ERROR_MESSAGE }]; + } + return []; + } catch (e) { + return handleInternalError(ruleName, path, e); + } +} diff --git a/tools/spectral/ipa/rulesets/functions/IPA111OptionalFieldsNoDefault.js b/tools/spectral/ipa/rulesets/functions/IPA111OptionalFieldsNoDefault.js new file mode 100644 index 00000000000..85c97a7e8f0 --- /dev/null +++ b/tools/spectral/ipa/rulesets/functions/IPA111OptionalFieldsNoDefault.js @@ -0,0 +1,48 @@ +import { evaluateAndCollectAdoptionStatus, handleInternalError } from './utils/collectionUtils.js'; +import { resolveObject } from './utils/componentUtils.js'; +import { isRequiredProperty } from './utils/schemaUtils.js'; +import { hasServerComputedWhenClientOmittedExtension } from './utils/extensions.js'; + +const ERROR_MESSAGE = + 'Optional fields must not define a default value. Remove the default or mark the field with x-xgen-server-computed-when-client-omitted if the server computes it when omitted.'; + +export default (input, _, { path, documentInventory, rule }) => { + const ruleName = rule.name; + const oas = documentInventory.unresolved; + const property = resolveObject(oas, path); + + // Skip schema references ($ref): + // Referenced schemas are validated separately to prevent duplicate violations + if (!property) { + return; + } + + // Boolean fields are handled by xgen-IPA-111-optional-boolean-fields-default-false + if (property.type === 'boolean') { + return; + } + + // The rule only applies to optional fields + if (isRequiredProperty(oas, path)) { + return; + } + + // Fields computed by the server when the client omits them are allowed to define a default + if (hasServerComputedWhenClientOmittedExtension(property)) { + return; + } + + const errors = checkViolationsAndReturnErrors(property, path, ruleName); + return evaluateAndCollectAdoptionStatus(errors, ruleName, property, path); +}; + +function checkViolationsAndReturnErrors(property, path, ruleName) { + try { + if (property.default !== undefined) { + return [{ path, message: ERROR_MESSAGE }]; + } + return []; + } catch (e) { + return handleInternalError(ruleName, path, e); + } +} diff --git a/tools/spectral/ipa/rulesets/functions/utils/extensions.js b/tools/spectral/ipa/rulesets/functions/utils/extensions.js index 29cc4884968..c7f551d450c 100644 --- a/tools/spectral/ipa/rulesets/functions/utils/extensions.js +++ b/tools/spectral/ipa/rulesets/functions/utils/extensions.js @@ -1,5 +1,17 @@ export const VERB_OVERRIDE_EXTENSION = 'x-xgen-method-verb-override'; export const OPERATION_ID_OVERRIDE_EXTENSION = 'x-xgen-operation-id-override'; +export const SERVER_COMPUTED_WHEN_CLIENT_OMITTED_EXTENSION = 'x-xgen-server-computed-when-client-omitted'; + +/** + * Checks if the object has the extension "x-xgen-server-computed-when-client-omitted", marking a field + * whose value is computed by the server when the client omits it. + * + * @param object the object to evaluate + * @returns {boolean} true if the object has the extension, otherwise false + */ +export function hasServerComputedWhenClientOmittedExtension(object) { + return Object.keys(object).includes(SERVER_COMPUTED_WHEN_CLIENT_OMITTED_EXTENSION); +} /** * Checks if the object has an extension "x-xgen-method-verb-override" with the customMethod boolean set to true diff --git a/tools/spectral/ipa/rulesets/functions/utils/schemaUtils.js b/tools/spectral/ipa/rulesets/functions/utils/schemaUtils.js index 5dfd8d09918..6ec0d09ffc9 100644 --- a/tools/spectral/ipa/rulesets/functions/utils/schemaUtils.js +++ b/tools/spectral/ipa/rulesets/functions/utils/schemaUtils.js @@ -1,3 +1,21 @@ +import { resolveObject } from './componentUtils.js'; + +/** + * Checks if a schema property is listed as required by its parent schema. + * + * Given the JSON path to a property (ending in `['properties', '']`), this resolves the + * enclosing schema object and inspects its `required` array. + * + * @param {Object} oas the OpenAPI Specification object to resolve against + * @param {string[]} propertyPath the JSON path to the property + * @returns {boolean} true if the property is listed in the parent schema's `required` array, false otherwise + */ +export function isRequiredProperty(oas, propertyPath) { + const propertyName = propertyPath[propertyPath.length - 1]; + const parentSchema = resolveObject(oas, propertyPath.slice(0, propertyPath.length - 2)); + return Array.isArray(parentSchema?.required) && parentSchema.required.includes(propertyName); +} + /** * Checks if the object has results property * @param {Object} schema From 308ef013935d8b6d5d867349a167ee255c547d43 Mon Sep 17 00:00:00 2001 From: Yeliz Henden Date: Fri, 28 Aug 2026 16:47:44 +0100 Subject: [PATCH 2/5] overrides --- tools/spectral/ipa/ipa-spectral.yaml | 73 ++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/tools/spectral/ipa/ipa-spectral.yaml b/tools/spectral/ipa/ipa-spectral.yaml index 9657ce17a8b..ab6bcfc6055 100644 --- a/tools/spectral/ipa/ipa-spectral.yaml +++ b/tools/spectral/ipa/ipa-spectral.yaml @@ -90,3 +90,76 @@ overrides: rules: xgen-IPA-107-operation-id-length: 'off' xgen-IPA-107-valid-operation-id: 'off' + - files: + - '**#/components/schemas/S3LogIntegrationRequest/allOf/1/properties/useLegacyPathStructure' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/S3LogIntegrationResponse/allOf/1/properties/useLegacyPathStructure' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/SandboxConfigRequest/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/SandboxConfigResponse/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/SandboxConfigUpdateRequest/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/SearchDeploymentAuditView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/SearchHostStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/SearchIndexResponse/properties/queryable' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/SearchMainIndexStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/SearchStagedIndexStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ServiceAccountGroupEvents/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ServiceAccountOrgEvents/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/StreamsAutoscaling/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/StreamsModifyStreamProcessor/properties/failoverEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/StreamsModifyStreamProcessorOptions/properties/resumeFromCheckpoint' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/StreamsProcessor/properties/failoverEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/StreamsProcessorWithStats/properties/eligibleForFailover' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/StreamsProcessorWithStats/properties/failoverEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/StreamsStartProcessorFailover/properties/clearCheckpoint' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/StreamsStartProcessorFailover/properties/dryRun' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/StreamsStartStreamProcessorWith/properties/resumeFromCheckpoint' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/SynonymMappingStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TeamEvent/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TeamEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TeamNotification/properties/emailEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TeamNotification/properties/smsEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TextSearchHostStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TextSearchIndexStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TimeMetricEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/generateNumberParts' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/generateWordParts' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/preserveOriginal' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/splitOnCaseChange' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/splitOnNumerics' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/stemEnglishPossessive' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/protectedWords/properties/ignoreCase' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/UsageDetailsFilterRequest/properties/includeZeroCentLineItems' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/UserEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/UserEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/UserNotification/properties/emailEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/UserNotification/properties/smsEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/VectorSearchHostStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/VectorSearchIndexStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/tokenFilterstopword/properties/ignoreCase' # to be addressed in CLOUDP-439952 + rules: + xgen-IPA-111-optional-boolean-fields-default-false: 'off' + - files: + - '**#/components/schemas/SearchIndex/allOf/1/properties/analyzer' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/SearchIndex/allOf/1/properties/searchAnalyzer' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/SearchIndexDefinition/properties/numPartitions' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ServerlessProviderSettings/properties/providerName' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TextSearchIndexDefinition/properties/analyzer' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TextSearchIndexDefinition/properties/numPartitions' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/TextSearchIndexDefinition/properties/searchAnalyzer' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/UserCert/properties/monthsUntilExpiration' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/VectorSearchIndexDefinition/properties/numPartitions' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/tokenFilterasciiFolding/properties/originalTokens' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/tokenFilterdaitchMokotoffSoundex/properties/originalTokens' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/tokenFilteredgeGram/properties/termNotInBounds' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/tokenFiltericuNormalizer/properties/normalizationForm' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/tokenFilterlength/properties/max' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/tokenFilterlength/properties/min' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/tokenFilternGram/properties/termNotInBounds' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/tokenizerstandard/properties/maxTokenLength' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/tokenizeruaxUrlEmail/properties/maxTokenLength' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/tokenizerwhitespace/properties/maxTokenLength' # to be addressed in CLOUDP-439952 + rules: + xgen-IPA-111-optional-fields-no-default: 'off' + - files: + - '**#/components/schemas/ServerlessProviderSettings/properties/effectiveInstanceSizeName' # to be addressed in CLOUDP-439952 + rules: + xgen-IPA-111-effective-fields-read-only: 'off' From d10fb379cba3a33b3f2aba25fe649d0a878e5047 Mon Sep 17 00:00:00 2001 From: Wojciech Date: Thu, 3 Sep 2026 10:44:19 +0200 Subject: [PATCH 3/5] fix(ipa): complete IPA-111 override list to suppress all 318 spec violations The original PR had 64 override entries but the Atlas v2 spec has 318 violations for the three new IPA-111 rules. Without the full list, ipa-validation would fail with 254 errors. Added 209 boolean, 96 no-default, and 13 effective overrides (all tracked under CLOUDP-439952). Verified zero violations on v2.yaml. --- tools/spectral/ipa/ipa-spectral.yaml | 254 +++++++++++++++++++++++++++ 1 file changed, 254 insertions(+) diff --git a/tools/spectral/ipa/ipa-spectral.yaml b/tools/spectral/ipa/ipa-spectral.yaml index ab6bcfc6055..1a3d7c99ffe 100644 --- a/tools/spectral/ipa/ipa-spectral.yaml +++ b/tools/spectral/ipa/ipa-spectral.yaml @@ -91,6 +91,171 @@ overrides: xgen-IPA-107-operation-id-length: 'off' xgen-IPA-107-valid-operation-id: 'off' - files: + - '**#/components/schemas/AWSCloudProviderSettings/allOf/1/properties/encryptEBSVolume' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AWSInterfaceEndpoint/properties/deleteRequested' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AWSKMSConfiguration/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AWSKMSConfiguration/properties/requirePrivateNetworking' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AWSKMSConfiguration/properties/valid' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AcknowledgeAlert/properties/unacknowledgeAlert' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AdvancedClusterDescription/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AdvancedClusterDescription/properties/paused' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AdvancedClusterDescription/properties/pitEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AdvancedComputeAutoScaling/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AdvancedComputeAutoScaling/properties/scaleDownEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AlertAudit/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AlertConfigAudit/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AlertsToggle/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiAtlasCheckpointView/properties/restorable' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/paused' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/pitEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/redactClientLogData' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiCheckpointPartView/properties/tokenDiscovered' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiUserEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiUserEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasOrganization/properties/isDeleted' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasResourcePolicyAuditForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasResourcePolicyAuditForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/paused' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/pitEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/redactClientLogData' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AutomationConfigEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AvailableCloudProviderRegion/properties/default' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AzureKeyVault/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AzureKeyVault/properties/requirePrivateNetworking' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AzureKeyVault/properties/valid' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AzurePrivateEndpoint/properties/deleteRequested' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BackupOnlineArchive/properties/paused' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BackupOnlineArchiveCreate/properties/paused' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BackupRestoreJob/properties/encryptionEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BackupSnapshot/properties/complete' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BackupSnapshot/properties/doNotDelete' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BackupSnapshot/properties/incremental' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BackupSnapshotPart/properties/encryptionEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BiConnector/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BillingEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BillingEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ChartsAudit/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/CloudCluster/properties/authEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/CloudCluster/properties/backupEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/CloudCluster/properties/sslEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/CloudProviderContainer/properties/provisioned' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterConfigurationValidationResult/properties/valid' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescription20240805/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescription20240805/properties/paused' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescription20240805/properties/pitEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescription20240805/properties/redactClientLogData' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/failIndexKeyTooLong' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/javascriptEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/noTableScan' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescriptionProcessArgs20240805/properties/javascriptEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescriptionProcessArgs20240805/properties/noTableScan' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterServerlessBackupOptions/properties/serverlessContinuousBackupEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ConnectedOrgConfig/properties/instantUserProvisioningDisabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/CostExplorerFilterRequestBody/properties/includePartialMatches' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DataExplorerAccessedEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DataExplorerEvent/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DataMetricEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DefaultEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DefaultEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupCopySetting/properties/shouldCopyOplogs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupCopySetting20240805/properties/shouldCopyOplogs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotAWSExportBucketRequest/allOf/1/properties/requirePrivateNetworking' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotAWSExportBucketResponse/properties/requirePrivateNetworking' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotRestoreJob/properties/cancelled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotRestoreJob/properties/expired' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotRestoreJob/properties/failed' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/autoExportEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/copyPolicyItemsEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/deleteCopySnapshots' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/deleteSnapshots' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/updateCopySnapshots' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/updateSnapshots' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/useOrgAndGroupNamesInExportPrefix' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/autoCopySettingsEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/autoExportEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/copyPolicyItemsEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/deleteCopySnapshots' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/deleteSnapshots' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/updateCopySnapshots' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/updateSnapshots' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/useOrgAndGroupNamesInExportPrefix' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DiskGBAutoScaling/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/EncryptionAtRest/properties/enabledForSearchNodes' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/EventTypeDetails/properties/alertable' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/FTSIndexAuditView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/FederationSamlIdentityProvider/properties/ssoDebugEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/FlexBackupSettings20241113/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GCPEndpointService/properties/portMappingEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GeoSharding/properties/selfManagedSharding' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GeoSharding20240805/properties/selfManagedSharding' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GoogleCloudKMS/properties/enabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GoogleCloudKMS/properties/valid' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/Group/properties/withDefaultAlertsSettings' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupMaintenanceWindow/properties/autoDeferOnceEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupMaintenanceWindow/properties/startASAP' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupMaintenanceWindowPreviewResponse/properties/autoDeferOnceEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupMaintenanceWindowPreviewResponse/properties/startASAP' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupMaintenanceWindowPreviewUpdateRequest/properties/autoDeferOnceEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupMaintenanceWindowPreviewUpdateRequest/properties/startASAP' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupNotification/properties/emailEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupNotification/properties/smsEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupSettings/properties/isAtlasHomePageAiAssistantEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupSettings/properties/isClusterAiAssistantEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupSettings/properties/isCollectDatabaseSpecificsStatisticsEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupSettings/properties/isDataExplorerEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupSettings/properties/isDataExplorerGenAIFeaturesEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupSettings/properties/isDataValidationEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupSettings/properties/isExtendedStorageSizesEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupSettings/properties/isNativeRerankingEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupSettings/properties/isPerformanceAdvisorEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupSettings/properties/isRealtimePerformancePanelEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupSettings/properties/isSchemaAdvisorEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GroupUpdate/properties/withDefaultAlertsSettings' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/HostEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/HostMetricEvent/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LDAPSecuritySettings/properties/authenticationEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LDAPSecuritySettings/properties/authorizationEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/backupEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/paused' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/pitEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/providerBackupEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/backupEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/paused' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/pitEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/providerBackupEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LiveMigrationResponse/properties/readyForCutover' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/MongoDBAccessLogs/properties/authResult' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/NDSAuditViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/NDSAuditViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/NDSAutoScalingAuditViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/NDSServerlessInstanceAuditView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/NDSTenantEndpointAuditView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/NumberMetricEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/OrgEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/OrgFederationSettings/properties/hasRoleMappings' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/OrgNotification/properties/emailEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/OrgNotification/properties/smsEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/OrganizationSettings/properties/apiAccessListRequired' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/OrganizationSettings/properties/genAIFeaturesEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/OrganizationSettings/properties/multiFactorAuthRequired' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/OrganizationSettings/properties/restrictEmployeeAccess' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/OrganizationSettings/properties/streamsCrossGroupEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/PerformanceAdvisorSlowQueryMetrics/properties/fromUserConnection' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/PerformanceAdvisorSlowQueryMetrics/properties/hasAutoEmbedding' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/PerformanceAdvisorSlowQueryMetrics/properties/hasIndexCoverage' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/PerformanceAdvisorSlowQueryMetrics/properties/hasRerank' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/PerformanceAdvisorSlowQueryMetrics/properties/hasSort' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/PrivateGCPEndpointGroup/properties/deleteRequested' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/PrivateGCPEndpointGroup/properties/portMappingEnabled' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/PrivateLinkEndpoint/properties/deleteRequested' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/QueryStatsSummary/properties/systemQuery' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/RawMetricEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ResourceEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ResourceEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - '**#/components/schemas/S3LogIntegrationRequest/allOf/1/properties/useLegacyPathStructure' # to be addressed in CLOUDP-439952 - '**#/components/schemas/S3LogIntegrationResponse/allOf/1/properties/useLegacyPathStructure' # to be addressed in CLOUDP-439952 - '**#/components/schemas/SandboxConfigRequest/properties/enabled' # to be addressed in CLOUDP-439952 @@ -138,6 +303,83 @@ overrides: rules: xgen-IPA-111-optional-boolean-fields-default-false: 'off' - files: + - '**#/components/schemas/AWSHardwareSpec/properties/ebsVolumeType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AWSHardwareSpec20240805/properties/ebsVolumeType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AdvancedClusterDescription/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AdvancedClusterDescription/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AdvancedClusterDescription/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AdvancedClusterDescription/properties/rootCertType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AdvancedClusterDescription/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/rootCertType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ApiDateCriteria/allOf/1/properties/dateFormat' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/rootCertType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BackupOnlineArchive/properties/collectionType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/BackupOnlineArchiveCreate/properties/collectionType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/CloudDatabaseUser/properties/awsIAMType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/CloudDatabaseUser/properties/ldapAuthType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/CloudDatabaseUser/properties/oidcAuthType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/CloudDatabaseUser/properties/x509Type' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescription20240805/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescription20240805/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescription20240805/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescription20240805/properties/rootCertType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescription20240805/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/changeStreamOptionsPreAndPostImagesExpireAfterSeconds' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/defaultReadConcern' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/sampleRefreshIntervalBIConnector' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescriptionProcessArgs20240805/properties/changeStreamOptionsPreAndPostImagesExpireAfterSeconds' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterDescriptionProcessArgs20240805/properties/sampleRefreshIntervalBIConnector' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/ClusterSearchIndex/properties/numPartitions' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/Collation/properties/alternate' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/Collation/properties/caseFirst' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/Collation/properties/strength' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DataLakeDatabaseInstance/properties/maxWildcardCollections' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DatadogNotification/properties/datadogRegion' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/DateCriteriaView/allOf/1/properties/dateFormat' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/FlexClusterDescription20241113/properties/clusterType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/FlexClusterDescription20241113/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/FlexProviderSettings20241113/properties/providerName' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/FlexProviderSettingsCreate20241113/properties/providerName' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/Group/properties/regionUsageRestrictions' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/IndexOptions/properties/2dsphereIndexVersion' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/IndexOptions/properties/bits' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/IndexOptions/properties/default_language' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/IndexOptions/properties/language_override' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/IndexOptions/properties/max' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/IndexOptions/properties/min' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/IndexOptions/properties/textIndexVersion' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LDAPSecuritySettings/properties/authzQueryTemplate' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LDAPSecuritySettings/properties/port' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LDAPVerifyConnectivityJobRequestParams/properties/authzQueryTemplate' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/numShards' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/replicationFactor' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/rootCertType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasCluster/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/numShards' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/replicationFactor' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/rootCertType' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/LegacyReplicationSpec/properties/numShards' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/NamespaceObj/properties/type' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/OpsGenie/properties/region' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/OpsGenieNotification/properties/opsGenieRegion' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/PagerDutyNotification/properties/region' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/PrivateNetworkEndpointIdEntry/properties/provider' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/PrivateNetworkEndpointIdEntry/properties/type' # to be addressed in CLOUDP-439952 - '**#/components/schemas/SearchIndex/allOf/1/properties/analyzer' # to be addressed in CLOUDP-439952 - '**#/components/schemas/SearchIndex/allOf/1/properties/searchAnalyzer' # to be addressed in CLOUDP-439952 - '**#/components/schemas/SearchIndexDefinition/properties/numPartitions' # to be addressed in CLOUDP-439952 @@ -160,6 +402,18 @@ overrides: rules: xgen-IPA-111-optional-fields-no-default: 'off' - files: + - '**#/components/schemas/AWSRegionConfig20240805/allOf/1/properties/effectiveAnalyticsSpecs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AWSRegionConfig20240805/allOf/1/properties/effectiveElectableSpecs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AWSRegionConfig20240805/allOf/1/properties/effectiveReadOnlySpecs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AlibabaRegionConfig20240805/allOf/1/properties/effectiveAnalyticsSpecs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AlibabaRegionConfig20240805/allOf/1/properties/effectiveElectableSpecs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AlibabaRegionConfig20240805/allOf/1/properties/effectiveReadOnlySpecs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AzureRegionConfig20240805/allOf/1/properties/effectiveAnalyticsSpecs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AzureRegionConfig20240805/allOf/1/properties/effectiveElectableSpecs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/AzureRegionConfig20240805/allOf/1/properties/effectiveReadOnlySpecs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GCPRegionConfig20240805/allOf/1/properties/effectiveAnalyticsSpecs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GCPRegionConfig20240805/allOf/1/properties/effectiveElectableSpecs' # to be addressed in CLOUDP-439952 + - '**#/components/schemas/GCPRegionConfig20240805/allOf/1/properties/effectiveReadOnlySpecs' # to be addressed in CLOUDP-439952 - '**#/components/schemas/ServerlessProviderSettings/properties/effectiveInstanceSizeName' # to be addressed in CLOUDP-439952 rules: xgen-IPA-111-effective-fields-read-only: 'off' From 51eac3d7824ce2316828103e21873d24b51684ad Mon Sep 17 00:00:00 2001 From: Wojciech Date: Thu, 3 Sep 2026 12:28:13 +0200 Subject: [PATCH 4/5] refactor(ipa): scope IPA-111 boolean and no-default rules to request schemas only Response schemas and component schemas used in responses are now excluded from the optional-boolean-fields-default-false and optional-fields-no-default rules via pathIsForRequestVersion guard. This reduces the override list from 318 to 13 entries (only effective-fields-read-only requires component-level overrides). Also regenerated ruleset README. --- ...1OptionalBooleanFieldsDefaultFalse.test.js | 41 +-- .../IPA111OptionalFieldsNoDefault.test.js | 32 +- tools/spectral/ipa/ipa-spectral.yaml | 311 ------------------ tools/spectral/ipa/rulesets/IPA-111.yaml | 8 +- ...IPA111OptionalBooleanFieldsDefaultFalse.js | 7 +- .../IPA111OptionalFieldsNoDefault.js | 7 +- 6 files changed, 22 insertions(+), 384 deletions(-) diff --git a/tools/spectral/ipa/__tests__/IPA111OptionalBooleanFieldsDefaultFalse.test.js b/tools/spectral/ipa/__tests__/IPA111OptionalBooleanFieldsDefaultFalse.test.js index 4512d78d522..5755045d505 100644 --- a/tools/spectral/ipa/__tests__/IPA111OptionalBooleanFieldsDefaultFalse.test.js +++ b/tools/spectral/ipa/__tests__/IPA111OptionalBooleanFieldsDefaultFalse.test.js @@ -52,7 +52,7 @@ testRule('xgen-IPA-111-optional-boolean-fields-default-false', [ errors: [], }, { - name: 'invalid optional boolean field without default', + name: 'valid optional boolean field without default in component (request-scoped, skipped)', document: { components: { schemas: { @@ -65,17 +65,10 @@ testRule('xgen-IPA-111-optional-boolean-fields-default-false', [ }, }, }, - errors: [ - { - code: 'xgen-IPA-111-optional-boolean-fields-default-false', - message: 'Optional boolean fields must default to false.', - path: ['components', 'schemas', 'Schema', 'properties', 'enabled'], - severity: DiagnosticSeverity.Error, - }, - ], + errors: [], }, { - name: 'invalid optional boolean field with default true', + name: 'valid optional boolean field with default true in component (request-scoped, skipped)', document: { components: { schemas: { @@ -88,17 +81,10 @@ testRule('xgen-IPA-111-optional-boolean-fields-default-false', [ }, }, }, - errors: [ - { - code: 'xgen-IPA-111-optional-boolean-fields-default-false', - message: 'Optional boolean fields must default to false.', - path: ['components', 'schemas', 'Schema', 'properties', 'enabled'], - severity: DiagnosticSeverity.Error, - }, - ], + errors: [], }, { - name: 'invalid optional boolean field in request and response', + name: 'invalid optional boolean field in request (paused) but response is skipped', document: { paths: { '/resources': { @@ -150,23 +136,6 @@ testRule('xgen-IPA-111-optional-boolean-fields-default-false', [ ], severity: DiagnosticSeverity.Error, }, - { - code: 'xgen-IPA-111-optional-boolean-fields-default-false', - message: 'Optional boolean fields must default to false.', - path: [ - 'paths', - '/resources', - 'post', - 'responses', - '201', - 'content', - 'application/vnd.atlas.2024-01-01+json', - 'schema', - 'properties', - 'hidden', - ], - severity: DiagnosticSeverity.Error, - }, ], }, { diff --git a/tools/spectral/ipa/__tests__/IPA111OptionalFieldsNoDefault.test.js b/tools/spectral/ipa/__tests__/IPA111OptionalFieldsNoDefault.test.js index fb320c0f1b1..efaf82c1285 100644 --- a/tools/spectral/ipa/__tests__/IPA111OptionalFieldsNoDefault.test.js +++ b/tools/spectral/ipa/__tests__/IPA111OptionalFieldsNoDefault.test.js @@ -72,7 +72,7 @@ testRule('xgen-IPA-111-optional-fields-no-default', [ errors: [], }, { - name: 'invalid optional field with default', + name: 'valid optional field with default in component (request-scoped, skipped)', document: { components: { schemas: { @@ -85,18 +85,10 @@ testRule('xgen-IPA-111-optional-fields-no-default', [ }, }, }, - errors: [ - { - code: 'xgen-IPA-111-optional-fields-no-default', - message: - 'Optional fields must not define a default value. Remove the default or mark the field with x-xgen-server-computed-when-client-omitted if the server computes it when omitted.', - path: ['components', 'schemas', 'Schema', 'properties', 'name'], - severity: DiagnosticSeverity.Error, - }, - ], + errors: [], }, { - name: 'invalid optional field with default in request and response', + name: 'invalid optional field with default in request body (response is skipped)', document: { paths: { '/resources': { @@ -149,24 +141,6 @@ testRule('xgen-IPA-111-optional-fields-no-default', [ ], severity: DiagnosticSeverity.Error, }, - { - code: 'xgen-IPA-111-optional-fields-no-default', - message: - 'Optional fields must not define a default value. Remove the default or mark the field with x-xgen-server-computed-when-client-omitted if the server computes it when omitted.', - path: [ - 'paths', - '/resources', - 'post', - 'responses', - '201', - 'content', - 'application/vnd.atlas.2024-01-01+json', - 'schema', - 'properties', - 'region', - ], - severity: DiagnosticSeverity.Error, - }, ], }, { diff --git a/tools/spectral/ipa/ipa-spectral.yaml b/tools/spectral/ipa/ipa-spectral.yaml index 1a3d7c99ffe..2f37bc8c4aa 100644 --- a/tools/spectral/ipa/ipa-spectral.yaml +++ b/tools/spectral/ipa/ipa-spectral.yaml @@ -90,317 +90,6 @@ overrides: rules: xgen-IPA-107-operation-id-length: 'off' xgen-IPA-107-valid-operation-id: 'off' - - files: - - '**#/components/schemas/AWSCloudProviderSettings/allOf/1/properties/encryptEBSVolume' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AWSInterfaceEndpoint/properties/deleteRequested' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AWSKMSConfiguration/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AWSKMSConfiguration/properties/requirePrivateNetworking' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AWSKMSConfiguration/properties/valid' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AcknowledgeAlert/properties/unacknowledgeAlert' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AdvancedClusterDescription/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AdvancedClusterDescription/properties/paused' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AdvancedClusterDescription/properties/pitEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AdvancedComputeAutoScaling/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AdvancedComputeAutoScaling/properties/scaleDownEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AlertAudit/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AlertConfigAudit/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AlertsToggle/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiAtlasCheckpointView/properties/restorable' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/paused' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/pitEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/redactClientLogData' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiCheckpointPartView/properties/tokenDiscovered' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiUserEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiUserEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasOrganization/properties/isDeleted' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasResourcePolicyAuditForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasResourcePolicyAuditForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/paused' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/pitEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/redactClientLogData' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AutomationConfigEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AvailableCloudProviderRegion/properties/default' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AzureKeyVault/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AzureKeyVault/properties/requirePrivateNetworking' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AzureKeyVault/properties/valid' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AzurePrivateEndpoint/properties/deleteRequested' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BackupOnlineArchive/properties/paused' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BackupOnlineArchiveCreate/properties/paused' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BackupRestoreJob/properties/encryptionEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BackupSnapshot/properties/complete' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BackupSnapshot/properties/doNotDelete' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BackupSnapshot/properties/incremental' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BackupSnapshotPart/properties/encryptionEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BiConnector/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BillingEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BillingEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ChartsAudit/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/CloudCluster/properties/authEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/CloudCluster/properties/backupEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/CloudCluster/properties/sslEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/CloudProviderContainer/properties/provisioned' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterConfigurationValidationResult/properties/valid' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescription20240805/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescription20240805/properties/paused' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescription20240805/properties/pitEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescription20240805/properties/redactClientLogData' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/failIndexKeyTooLong' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/javascriptEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/noTableScan' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescriptionProcessArgs20240805/properties/javascriptEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescriptionProcessArgs20240805/properties/noTableScan' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterServerlessBackupOptions/properties/serverlessContinuousBackupEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ConnectedOrgConfig/properties/instantUserProvisioningDisabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/CostExplorerFilterRequestBody/properties/includePartialMatches' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DataExplorerAccessedEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DataExplorerEvent/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DataMetricEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DefaultEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DefaultEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupCopySetting/properties/shouldCopyOplogs' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupCopySetting20240805/properties/shouldCopyOplogs' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotAWSExportBucketRequest/allOf/1/properties/requirePrivateNetworking' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotAWSExportBucketResponse/properties/requirePrivateNetworking' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotRestoreJob/properties/cancelled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotRestoreJob/properties/expired' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotRestoreJob/properties/failed' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/autoExportEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/copyPolicyItemsEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/deleteCopySnapshots' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/deleteSnapshots' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/updateCopySnapshots' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/updateSnapshots' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule/properties/useOrgAndGroupNamesInExportPrefix' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/autoCopySettingsEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/autoExportEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/copyPolicyItemsEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/deleteCopySnapshots' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/deleteSnapshots' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/updateCopySnapshots' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/updateSnapshots' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskBackupSnapshotSchedule20240805/properties/useOrgAndGroupNamesInExportPrefix' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DiskGBAutoScaling/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/EncryptionAtRest/properties/enabledForSearchNodes' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/EventTypeDetails/properties/alertable' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/FTSIndexAuditView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/FederationSamlIdentityProvider/properties/ssoDebugEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/FlexBackupSettings20241113/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GCPEndpointService/properties/portMappingEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GeoSharding/properties/selfManagedSharding' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GeoSharding20240805/properties/selfManagedSharding' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GoogleCloudKMS/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GoogleCloudKMS/properties/valid' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/Group/properties/withDefaultAlertsSettings' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupMaintenanceWindow/properties/autoDeferOnceEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupMaintenanceWindow/properties/startASAP' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupMaintenanceWindowPreviewResponse/properties/autoDeferOnceEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupMaintenanceWindowPreviewResponse/properties/startASAP' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupMaintenanceWindowPreviewUpdateRequest/properties/autoDeferOnceEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupMaintenanceWindowPreviewUpdateRequest/properties/startASAP' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupNotification/properties/emailEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupNotification/properties/smsEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupSettings/properties/isAtlasHomePageAiAssistantEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupSettings/properties/isClusterAiAssistantEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupSettings/properties/isCollectDatabaseSpecificsStatisticsEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupSettings/properties/isDataExplorerEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupSettings/properties/isDataExplorerGenAIFeaturesEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupSettings/properties/isDataValidationEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupSettings/properties/isExtendedStorageSizesEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupSettings/properties/isNativeRerankingEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupSettings/properties/isPerformanceAdvisorEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupSettings/properties/isRealtimePerformancePanelEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupSettings/properties/isSchemaAdvisorEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/GroupUpdate/properties/withDefaultAlertsSettings' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/HostEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/HostMetricEvent/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LDAPSecuritySettings/properties/authenticationEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LDAPSecuritySettings/properties/authorizationEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/backupEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/paused' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/pitEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/providerBackupEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/backupEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/globalClusterSelfManagedSharding' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/paused' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/pitEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/providerBackupEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LiveMigrationResponse/properties/readyForCutover' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/MongoDBAccessLogs/properties/authResult' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/NDSAuditViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/NDSAuditViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/NDSAutoScalingAuditViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/NDSServerlessInstanceAuditView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/NDSTenantEndpointAuditView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/NumberMetricEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/OrgEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/OrgFederationSettings/properties/hasRoleMappings' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/OrgNotification/properties/emailEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/OrgNotification/properties/smsEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/OrganizationSettings/properties/apiAccessListRequired' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/OrganizationSettings/properties/genAIFeaturesEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/OrganizationSettings/properties/multiFactorAuthRequired' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/OrganizationSettings/properties/restrictEmployeeAccess' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/OrganizationSettings/properties/streamsCrossGroupEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/PerformanceAdvisorSlowQueryMetrics/properties/fromUserConnection' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/PerformanceAdvisorSlowQueryMetrics/properties/hasAutoEmbedding' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/PerformanceAdvisorSlowQueryMetrics/properties/hasIndexCoverage' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/PerformanceAdvisorSlowQueryMetrics/properties/hasRerank' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/PerformanceAdvisorSlowQueryMetrics/properties/hasSort' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/PrivateGCPEndpointGroup/properties/deleteRequested' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/PrivateGCPEndpointGroup/properties/portMappingEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/PrivateLinkEndpoint/properties/deleteRequested' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/QueryStatsSummary/properties/systemQuery' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/RawMetricEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ResourceEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ResourceEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/S3LogIntegrationRequest/allOf/1/properties/useLegacyPathStructure' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/S3LogIntegrationResponse/allOf/1/properties/useLegacyPathStructure' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SandboxConfigRequest/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SandboxConfigResponse/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SandboxConfigUpdateRequest/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SearchDeploymentAuditView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SearchHostStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SearchIndexResponse/properties/queryable' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SearchMainIndexStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SearchStagedIndexStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ServiceAccountGroupEvents/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ServiceAccountOrgEvents/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/StreamsAutoscaling/properties/enabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/StreamsModifyStreamProcessor/properties/failoverEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/StreamsModifyStreamProcessorOptions/properties/resumeFromCheckpoint' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/StreamsProcessor/properties/failoverEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/StreamsProcessorWithStats/properties/eligibleForFailover' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/StreamsProcessorWithStats/properties/failoverEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/StreamsStartProcessorFailover/properties/clearCheckpoint' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/StreamsStartProcessorFailover/properties/dryRun' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/StreamsStartStreamProcessorWith/properties/resumeFromCheckpoint' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SynonymMappingStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TeamEvent/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TeamEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TeamNotification/properties/emailEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TeamNotification/properties/smsEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TextSearchHostStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TextSearchIndexStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TimeMetricEventView/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/generateNumberParts' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/generateWordParts' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/preserveOriginal' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/splitOnCaseChange' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/splitOnNumerics' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/delimiterOptions/properties/stemEnglishPossessive' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TokenFilterWordDelimiterGraph/properties/protectedWords/properties/ignoreCase' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/UsageDetailsFilterRequest/properties/includeZeroCentLineItems' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/UserEventViewForNdsGroup/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/UserEventViewForOrg/properties/isGlobalAdmin' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/UserNotification/properties/emailEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/UserNotification/properties/smsEnabled' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/VectorSearchHostStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/VectorSearchIndexStatusDetail/properties/queryable' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/tokenFilterstopword/properties/ignoreCase' # to be addressed in CLOUDP-439952 - rules: - xgen-IPA-111-optional-boolean-fields-default-false: 'off' - - files: - - '**#/components/schemas/AWSHardwareSpec/properties/ebsVolumeType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AWSHardwareSpec20240805/properties/ebsVolumeType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AdvancedClusterDescription/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AdvancedClusterDescription/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AdvancedClusterDescription/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AdvancedClusterDescription/properties/rootCertType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AdvancedClusterDescription/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/rootCertType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiAtlasClusterDescriptionPreview/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ApiDateCriteria/allOf/1/properties/dateFormat' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/rootCertType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/AtlasTenantClusterUpgradeRequest20240805/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BackupOnlineArchive/properties/collectionType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/BackupOnlineArchiveCreate/properties/collectionType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/CloudDatabaseUser/properties/awsIAMType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/CloudDatabaseUser/properties/ldapAuthType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/CloudDatabaseUser/properties/oidcAuthType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/CloudDatabaseUser/properties/x509Type' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescription20240805/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescription20240805/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescription20240805/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescription20240805/properties/rootCertType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescription20240805/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/changeStreamOptionsPreAndPostImagesExpireAfterSeconds' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/defaultReadConcern' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescriptionProcessArgs/properties/sampleRefreshIntervalBIConnector' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescriptionProcessArgs20240805/properties/changeStreamOptionsPreAndPostImagesExpireAfterSeconds' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterDescriptionProcessArgs20240805/properties/sampleRefreshIntervalBIConnector' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ClusterSearchIndex/properties/numPartitions' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/Collation/properties/alternate' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/Collation/properties/caseFirst' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/Collation/properties/strength' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DataLakeDatabaseInstance/properties/maxWildcardCollections' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DatadogNotification/properties/datadogRegion' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/DateCriteriaView/allOf/1/properties/dateFormat' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/FlexClusterDescription20241113/properties/clusterType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/FlexClusterDescription20241113/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/FlexProviderSettings20241113/properties/providerName' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/FlexProviderSettingsCreate20241113/properties/providerName' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/Group/properties/regionUsageRestrictions' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/IndexOptions/properties/2dsphereIndexVersion' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/IndexOptions/properties/bits' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/IndexOptions/properties/default_language' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/IndexOptions/properties/language_override' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/IndexOptions/properties/max' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/IndexOptions/properties/min' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/IndexOptions/properties/textIndexVersion' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LDAPSecuritySettings/properties/authzQueryTemplate' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LDAPSecuritySettings/properties/port' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LDAPVerifyConnectivityJobRequestParams/properties/authzQueryTemplate' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/numShards' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/replicationFactor' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/rootCertType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasCluster/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/configServerManagementMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/diskWarmingMode' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/numShards' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/replicaSetScalingStrategy' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/replicationFactor' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/rootCertType' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyAtlasTenantClusterUpgradeRequest/properties/versionReleaseSystem' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/LegacyReplicationSpec/properties/numShards' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/NamespaceObj/properties/type' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/OpsGenie/properties/region' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/OpsGenieNotification/properties/opsGenieRegion' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/PagerDutyNotification/properties/region' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/PrivateNetworkEndpointIdEntry/properties/provider' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/PrivateNetworkEndpointIdEntry/properties/type' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SearchIndex/allOf/1/properties/analyzer' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SearchIndex/allOf/1/properties/searchAnalyzer' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/SearchIndexDefinition/properties/numPartitions' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/ServerlessProviderSettings/properties/providerName' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TextSearchIndexDefinition/properties/analyzer' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TextSearchIndexDefinition/properties/numPartitions' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/TextSearchIndexDefinition/properties/searchAnalyzer' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/UserCert/properties/monthsUntilExpiration' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/VectorSearchIndexDefinition/properties/numPartitions' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/tokenFilterasciiFolding/properties/originalTokens' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/tokenFilterdaitchMokotoffSoundex/properties/originalTokens' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/tokenFilteredgeGram/properties/termNotInBounds' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/tokenFiltericuNormalizer/properties/normalizationForm' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/tokenFilterlength/properties/max' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/tokenFilterlength/properties/min' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/tokenFilternGram/properties/termNotInBounds' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/tokenizerstandard/properties/maxTokenLength' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/tokenizeruaxUrlEmail/properties/maxTokenLength' # to be addressed in CLOUDP-439952 - - '**#/components/schemas/tokenizerwhitespace/properties/maxTokenLength' # to be addressed in CLOUDP-439952 - rules: - xgen-IPA-111-optional-fields-no-default: 'off' - files: - '**#/components/schemas/AWSRegionConfig20240805/allOf/1/properties/effectiveAnalyticsSpecs' # to be addressed in CLOUDP-439952 - '**#/components/schemas/AWSRegionConfig20240805/allOf/1/properties/effectiveElectableSpecs' # to be addressed in CLOUDP-439952 diff --git a/tools/spectral/ipa/rulesets/IPA-111.yaml b/tools/spectral/ipa/rulesets/IPA-111.yaml index c3f3ffece69..5999d5ea362 100644 --- a/tools/spectral/ipa/rulesets/IPA-111.yaml +++ b/tools/spectral/ipa/rulesets/IPA-111.yaml @@ -13,7 +13,7 @@ rules: ##### Implementation details Rule checks for the following conditions: - - Applies to optional (non-required) schema properties in components, request bodies and responses + - Applies to optional (non-required) schema properties in request bodies only - Boolean fields are exempt (covered by xgen-IPA-111-optional-boolean-fields-default-false) - Fields marked with the x-xgen-server-computed-when-client-omitted extension are exempt - Fails if the field defines a default value @@ -21,9 +21,7 @@ rules: severity: error resolved: false given: - - '$.components.schemas..properties' - '$.paths..requestBody.content[?(@property.match(/json$/i))].schema..properties' - - '$.paths..responses..content[?(@property.match(/json$/i))].schema..properties' then: field: '@key' function: 'IPA111OptionalFieldsNoDefault' @@ -52,15 +50,13 @@ rules: ##### Implementation details Rule checks for the following conditions: - - Applies to optional (non-required) boolean schema properties in components, request bodies and responses + - Applies to optional (non-required) boolean schema properties in request bodies only - Fails if the field does not define a default value of false message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-111-optional-boolean-fields-default-false' severity: error resolved: false given: - - '$.components.schemas..properties' - '$.paths..requestBody.content[?(@property.match(/json$/i))].schema..properties' - - '$.paths..responses..content[?(@property.match(/json$/i))].schema..properties' then: field: '@key' function: 'IPA111OptionalBooleanFieldsDefaultFalse' diff --git a/tools/spectral/ipa/rulesets/functions/IPA111OptionalBooleanFieldsDefaultFalse.js b/tools/spectral/ipa/rulesets/functions/IPA111OptionalBooleanFieldsDefaultFalse.js index b694c63cad1..0ef2d808a2b 100644 --- a/tools/spectral/ipa/rulesets/functions/IPA111OptionalBooleanFieldsDefaultFalse.js +++ b/tools/spectral/ipa/rulesets/functions/IPA111OptionalBooleanFieldsDefaultFalse.js @@ -1,5 +1,5 @@ import { evaluateAndCollectAdoptionStatus, handleInternalError } from './utils/collectionUtils.js'; -import { resolveObject } from './utils/componentUtils.js'; +import { pathIsForRequestVersion, resolveObject } from './utils/componentUtils.js'; import { isRequiredProperty } from './utils/schemaUtils.js'; const ERROR_MESSAGE = 'Optional boolean fields must default to false.'; @@ -20,6 +20,11 @@ export default (input, _, { path, documentInventory, rule }) => { return; } + // Scoped to request schemas only + if (!pathIsForRequestVersion(path)) { + return; + } + const errors = checkViolationsAndReturnErrors(property, path, ruleName); return evaluateAndCollectAdoptionStatus(errors, ruleName, property, path); }; diff --git a/tools/spectral/ipa/rulesets/functions/IPA111OptionalFieldsNoDefault.js b/tools/spectral/ipa/rulesets/functions/IPA111OptionalFieldsNoDefault.js index 85c97a7e8f0..3e7a9890ec7 100644 --- a/tools/spectral/ipa/rulesets/functions/IPA111OptionalFieldsNoDefault.js +++ b/tools/spectral/ipa/rulesets/functions/IPA111OptionalFieldsNoDefault.js @@ -1,5 +1,5 @@ import { evaluateAndCollectAdoptionStatus, handleInternalError } from './utils/collectionUtils.js'; -import { resolveObject } from './utils/componentUtils.js'; +import { pathIsForRequestVersion, resolveObject } from './utils/componentUtils.js'; import { isRequiredProperty } from './utils/schemaUtils.js'; import { hasServerComputedWhenClientOmittedExtension } from './utils/extensions.js'; @@ -32,6 +32,11 @@ export default (input, _, { path, documentInventory, rule }) => { return; } + // Scoped to request schemas only + if (!pathIsForRequestVersion(path)) { + return; + } + const errors = checkViolationsAndReturnErrors(property, path, ruleName); return evaluateAndCollectAdoptionStatus(errors, ruleName, property, path); }; From c8dc50e4eb1de702a65c51d863af45602d37fb5f Mon Sep 17 00:00:00 2001 From: Wojciech Date: Thu, 3 Sep 2026 12:44:28 +0200 Subject: [PATCH 5/5] chore(ipa): regenerate ruleset README after IPA-111 scoping change --- 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 64de5a8d9ef..cf6476dd792 100644 --- a/tools/spectral/ipa/rulesets/README.md +++ b/tools/spectral/ipa/rulesets/README.md @@ -787,7 +787,7 @@ Optional fields must not define a default value. ##### Implementation details Rule checks for the following conditions: - - Applies to optional (non-required) schema properties in components, request bodies and responses + - Applies to optional (non-required) schema properties in request bodies only - Boolean fields are exempt (covered by xgen-IPA-111-optional-boolean-fields-default-false) - Fields marked with the x-xgen-server-computed-when-client-omitted extension are exempt - Fails if the field defines a default value @@ -810,7 +810,7 @@ Optional boolean fields must default to false. ##### Implementation details Rule checks for the following conditions: - - Applies to optional (non-required) boolean schema properties in components, request bodies and responses + - Applies to optional (non-required) boolean schema properties in request bodies only - Fails if the field does not define a default value of false