diff --git a/tools/spectral/ipa/__tests__/IPA110CollectionsRequestHasItemsPerPageQueryParam.test.js b/tools/spectral/ipa/__tests__/IPA110CollectionsRequestHasItemsPerPageQueryParam.test.js index ab5bc7c3b7..5e47272e41 100644 --- a/tools/spectral/ipa/__tests__/IPA110CollectionsRequestHasItemsPerPageQueryParam.test.js +++ b/tools/spectral/ipa/__tests__/IPA110CollectionsRequestHasItemsPerPageQueryParam.test.js @@ -75,7 +75,7 @@ testRule('xgen-IPA-110-collections-request-has-itemsPerPage-query-param', [ code: 'xgen-IPA-110-collections-request-has-itemsPerPage-query-param', message: 'List method is missing query parameters.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -120,13 +120,13 @@ testRule('xgen-IPA-110-collections-request-has-itemsPerPage-query-param', [ code: 'xgen-IPA-110-collections-request-has-itemsPerPage-query-param', message: 'List method is missing a itemsPerPage query parameter.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-110-collections-request-has-itemsPerPage-query-param', message: 'List method is missing a itemsPerPage query parameter.', path: ['paths', '/resourcesTwo', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -159,7 +159,7 @@ testRule('xgen-IPA-110-collections-request-has-itemsPerPage-query-param', [ code: 'xgen-IPA-110-collections-request-has-itemsPerPage-query-param', message: 'itemsPerPage query parameter of List method must not be required.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -190,7 +190,7 @@ testRule('xgen-IPA-110-collections-request-has-itemsPerPage-query-param', [ code: 'xgen-IPA-110-collections-request-has-itemsPerPage-query-param', message: 'itemsPerPage query parameter of List method must have a default value defined.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -222,7 +222,7 @@ testRule('xgen-IPA-110-collections-request-has-itemsPerPage-query-param', [ code: 'xgen-IPA-110-collections-request-has-itemsPerPage-query-param', message: 'itemsPerPage query parameter of List method must have a default value of 100.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA110CollectionsRequestHasPageNumQueryParam.test.js b/tools/spectral/ipa/__tests__/IPA110CollectionsRequestHasPageNumQueryParam.test.js index 8f8a05918a..bcf1146e6e 100644 --- a/tools/spectral/ipa/__tests__/IPA110CollectionsRequestHasPageNumQueryParam.test.js +++ b/tools/spectral/ipa/__tests__/IPA110CollectionsRequestHasPageNumQueryParam.test.js @@ -75,7 +75,7 @@ testRule('xgen-IPA-110-collections-request-has-pageNum-query-param', [ code: 'xgen-IPA-110-collections-request-has-pageNum-query-param', message: 'List method is missing query parameters.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -120,13 +120,13 @@ testRule('xgen-IPA-110-collections-request-has-pageNum-query-param', [ code: 'xgen-IPA-110-collections-request-has-pageNum-query-param', message: 'List method is missing a pageNum query parameter.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-110-collections-request-has-pageNum-query-param', message: 'List method is missing a pageNum query parameter.', path: ['paths', '/resourcesTwo', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -159,7 +159,7 @@ testRule('xgen-IPA-110-collections-request-has-pageNum-query-param', [ code: 'xgen-IPA-110-collections-request-has-pageNum-query-param', message: 'pageNum query parameter of List method must not be required.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -190,7 +190,7 @@ testRule('xgen-IPA-110-collections-request-has-pageNum-query-param', [ code: 'xgen-IPA-110-collections-request-has-pageNum-query-param', message: 'pageNum query parameter of List method must have a default value defined.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -222,7 +222,7 @@ testRule('xgen-IPA-110-collections-request-has-pageNum-query-param', [ code: 'xgen-IPA-110-collections-request-has-pageNum-query-param', message: 'pageNum query parameter of List method must have a default value of 1.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA110CollectionsRequestIncludeCountNotRequired.test.js b/tools/spectral/ipa/__tests__/IPA110CollectionsRequestIncludeCountNotRequired.test.js index 9621d7102a..b93c044296 100644 --- a/tools/spectral/ipa/__tests__/IPA110CollectionsRequestIncludeCountNotRequired.test.js +++ b/tools/spectral/ipa/__tests__/IPA110CollectionsRequestIncludeCountNotRequired.test.js @@ -120,7 +120,7 @@ testRule('xgen-IPA-110-collections-request-includeCount-not-required', [ code: 'xgen-IPA-110-collections-request-includeCount-not-required', message: 'includeCount query parameter of List method must not be required.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -156,7 +156,7 @@ testRule('xgen-IPA-110-collections-request-includeCount-not-required', [ code: 'xgen-IPA-110-collections-request-includeCount-not-required', message: 'includeCount query parameter of List method must not be required.', path: ['paths', '/resources', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA110CollectionsResponseDefineLinksArray.test.js b/tools/spectral/ipa/__tests__/IPA110CollectionsResponseDefineLinksArray.test.js index 17f41cff77..2bee3fe27f 100644 --- a/tools/spectral/ipa/__tests__/IPA110CollectionsResponseDefineLinksArray.test.js +++ b/tools/spectral/ipa/__tests__/IPA110CollectionsResponseDefineLinksArray.test.js @@ -108,7 +108,7 @@ testRule('xgen-IPA-110-collections-response-define-links-array', [ message: 'The response for collections should define a links array field, providing links to next and previous pages.', path: ['paths', '/resources', 'get', 'responses', '200', 'content', 'application/json'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA110CollectionsResponseDefineResultsArray.test.js b/tools/spectral/ipa/__tests__/IPA110CollectionsResponseDefineResultsArray.test.js index 91e50094ed..23171defe6 100644 --- a/tools/spectral/ipa/__tests__/IPA110CollectionsResponseDefineResultsArray.test.js +++ b/tools/spectral/ipa/__tests__/IPA110CollectionsResponseDefineResultsArray.test.js @@ -147,7 +147,7 @@ testRule('xgen-IPA-110-collections-response-define-results-array', [ code: 'xgen-IPA-110-collections-response-define-results-array', message: 'The response for collections must define an array of results containing the paginated resource.', path: ['paths', '/resources', 'get', 'responses', '200', 'content', 'application/json'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA110CollectionsUsePaginatedPrefix.test.js b/tools/spectral/ipa/__tests__/IPA110CollectionsUsePaginatedPrefix.test.js index 81e279fb46..efc429c76a 100644 --- a/tools/spectral/ipa/__tests__/IPA110CollectionsUsePaginatedPrefix.test.js +++ b/tools/spectral/ipa/__tests__/IPA110CollectionsUsePaginatedPrefix.test.js @@ -110,7 +110,7 @@ testRule('xgen-IPA-110-collections-use-paginated-prefix', [ message: 'List methods response must reference a paginated response schema. The response should reference a schema with "Paginated" prefix.', path: ['paths', '/resources', 'get', 'responses', '200', 'content', 'application/json'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -151,21 +151,21 @@ testRule('xgen-IPA-110-collections-use-paginated-prefix', [ message: 'List methods response must reference a paginated response schema. The response should reference a schema with "Paginated" prefix.', path: ['paths', '/resources', 'get', 'responses', '200', 'content', 'application/vnd.atlas.2024-08-05+json'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-110-collections-use-paginated-prefix', message: 'List methods response must reference a paginated response schema. The schema is defined inline and must reference a predefined paginated schema.', path: ['paths', '/resources', 'get', 'responses', '200', 'content', 'application/vnd.atlas.2024-01-01+json'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-110-collections-use-paginated-prefix', message: 'List methods response must reference a paginated response schema. The List method response does not have a schema defined.', path: ['paths', '/resources', 'get', 'responses', '200', 'content', 'application/vnd.atlas.2024-03-03+json'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -212,7 +212,7 @@ testRule('xgen-IPA-110-collections-use-paginated-prefix', [ code: 'xgen-IPA-110-collections-use-paginated-prefix', message: 'The schema is defined inline and must reference a predefined paginated schema.', path: ['paths', '/resources', 'get', 'responses', '200', 'content', 'application/json'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA112AvoidProjectFieldNames.test.js b/tools/spectral/ipa/__tests__/IPA112AvoidProjectFieldNames.test.js index 9fa0607339..ad67e958f0 100644 --- a/tools/spectral/ipa/__tests__/IPA112AvoidProjectFieldNames.test.js +++ b/tools/spectral/ipa/__tests__/IPA112AvoidProjectFieldNames.test.js @@ -109,25 +109,25 @@ testRule('xgen-IPA-112-avoid-project-field-names', [ code: 'xgen-IPA-112-avoid-project-field-names', message: 'Field name "project" should be avoided. Consider using "group" instead.', path: ['components', 'schemas', 'SchemaName', 'properties', 'project'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-avoid-project-field-names', message: 'Field name "projects" should be avoided. Consider using "groups" instead.', path: ['components', 'schemas', 'SchemaName', 'properties', 'projects'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-avoid-project-field-names', message: 'Field name "projectId" should be avoided. Consider using "group" instead.', path: ['components', 'schemas', 'SchemaName', 'properties', 'projectId'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-avoid-project-field-names', message: 'Field name "myProjectDetails" should be avoided. Consider using "group" instead.', path: ['components', 'schemas', 'SchemaName', 'properties', 'myProjectDetails'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-avoid-project-field-names', @@ -143,7 +143,7 @@ testRule('xgen-IPA-112-avoid-project-field-names', [ 'properties', 'projectId', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-avoid-project-field-names', @@ -160,7 +160,7 @@ testRule('xgen-IPA-112-avoid-project-field-names', [ 'properties', 'projectId', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA112BooleanFieldNamesAvoidIsPrefix.test.js b/tools/spectral/ipa/__tests__/IPA112BooleanFieldNamesAvoidIsPrefix.test.js index 4b8a0310a8..a353e018aa 100644 --- a/tools/spectral/ipa/__tests__/IPA112BooleanFieldNamesAvoidIsPrefix.test.js +++ b/tools/spectral/ipa/__tests__/IPA112BooleanFieldNamesAvoidIsPrefix.test.js @@ -108,19 +108,19 @@ testRule('xgen-IPA-112-boolean-field-names-avoid-is-prefix', [ code: 'xgen-IPA-112-boolean-field-names-avoid-is-prefix', message: 'Boolean field "isEnabled" should not use the "is" prefix. Use "enabled" instead.', path: ['components', 'schemas', 'SchemaName', 'properties', 'isEnabled'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-boolean-field-names-avoid-is-prefix', message: 'Boolean field "isActive" should not use the "is" prefix. Use "active" instead.', path: ['components', 'schemas', 'SchemaName', 'properties', 'isActive'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-boolean-field-names-avoid-is-prefix', message: 'Boolean field "isError" should not use the "is" prefix. Use "error" instead.', path: ['components', 'schemas', 'SchemaName', 'properties', 'isError'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-boolean-field-names-avoid-is-prefix', @@ -136,7 +136,7 @@ testRule('xgen-IPA-112-boolean-field-names-avoid-is-prefix', [ 'properties', 'isAvailable', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-boolean-field-names-avoid-is-prefix', @@ -153,7 +153,7 @@ testRule('xgen-IPA-112-boolean-field-names-avoid-is-prefix', [ 'properties', 'isValid', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -235,13 +235,13 @@ testRule('xgen-IPA-112-boolean-field-names-avoid-is-prefix', [ code: 'xgen-IPA-112-boolean-field-names-avoid-is-prefix', message: 'Boolean field "isEnabled" should not use the "is" prefix. Use "enabled" instead.', path: ['components', 'schemas', 'BooleanProperties', 'properties', 'isEnabled'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-boolean-field-names-avoid-is-prefix', message: 'Boolean field "isAdmin" should not use the "is" prefix. Use "admin" instead.', path: ['components', 'schemas', 'User', 'properties', 'isAdmin'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-boolean-field-names-avoid-is-prefix', @@ -256,7 +256,7 @@ testRule('xgen-IPA-112-boolean-field-names-avoid-is-prefix', [ 'properties', 'isEmailNotificationsEnabled', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-boolean-field-names-avoid-is-prefix', @@ -273,7 +273,7 @@ testRule('xgen-IPA-112-boolean-field-names-avoid-is-prefix', [ 'properties', 'isCached', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -316,7 +316,7 @@ testRule('xgen-IPA-112-boolean-field-names-avoid-is-prefix', [ code: 'xgen-IPA-112-boolean-field-names-avoid-is-prefix', message: 'Boolean field "isMfaEnabled" should not use the "is" prefix. Use "mfaEnabled" instead.', path: ['components', 'schemas', 'UserSettings', 'properties', 'isMfaEnabled'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA112FieldNamesAreCamelCase.test.js b/tools/spectral/ipa/__tests__/IPA112FieldNamesAreCamelCase.test.js index 95b3ffbfd6..fa7f8572f8 100644 --- a/tools/spectral/ipa/__tests__/IPA112FieldNamesAreCamelCase.test.js +++ b/tools/spectral/ipa/__tests__/IPA112FieldNamesAreCamelCase.test.js @@ -119,19 +119,19 @@ testRule('xgen-IPA-112-field-names-are-camel-case', [ code: 'xgen-IPA-112-field-names-are-camel-case', message: 'Property "UserId" must use camelCase format.', path: ['components', 'schemas', 'SchemaName', 'properties', 'UserId'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', message: 'Property "user_id" must use camelCase format.', path: ['components', 'schemas', 'SchemaName', 'properties', 'user_id'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', message: 'Property "user-id" must use camelCase format.', path: ['components', 'schemas', 'SchemaName', 'properties', 'user-id'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', @@ -147,7 +147,7 @@ testRule('xgen-IPA-112-field-names-are-camel-case', [ 'properties', 'First_Name', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', @@ -163,7 +163,7 @@ testRule('xgen-IPA-112-field-names-are-camel-case', [ 'properties', 'Email-Address', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', @@ -179,7 +179,7 @@ testRule('xgen-IPA-112-field-names-are-camel-case', [ 'properties', 'First_Name', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', @@ -196,7 +196,7 @@ testRule('xgen-IPA-112-field-names-are-camel-case', [ 'properties', 'First_Name', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -314,13 +314,13 @@ testRule('xgen-IPA-112-field-names-are-camel-case', [ code: 'xgen-IPA-112-field-names-are-camel-case', message: 'Property "Item_Id" must use camelCase format.', path: ['components', 'schemas', 'ArraySchema', 'items', 'properties', 'Item_Id'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', message: 'Property "ITEM-NAME" must use camelCase format.', path: ['components', 'schemas', 'ArraySchema', 'items', 'properties', 'ITEM-NAME'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -385,7 +385,7 @@ testRule('xgen-IPA-112-field-names-are-camel-case', [ code: 'xgen-IPA-112-field-names-are-camel-case', message: 'Property "First_Name" must use camelCase format.', path: ['components', 'schemas', 'NestedSchema', 'properties', 'userProfile', 'properties', 'First_Name'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', @@ -401,7 +401,7 @@ testRule('xgen-IPA-112-field-names-are-camel-case', [ 'properties', 'Email-Address', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -518,25 +518,25 @@ testRule('xgen-IPA-112-field-names-are-camel-case', [ code: 'xgen-IPA-112-field-names-are-camel-case', message: 'Property "State_Name" must use camelCase format.', path: ['components', 'schemas', 'Address', 'properties', 'State_Name'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', message: 'Property "Last_Name" must use camelCase format.', path: ['components', 'schemas', 'User', 'properties', 'Last_Name'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', message: 'Property "primary_address" must use camelCase format.', path: ['components', 'schemas', 'User', 'properties', 'primary_address'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', message: 'Property "email_address" must use camelCase format.', path: ['components', 'schemas', 'User', 'properties', 'contactInfo', 'properties', 'email_address'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', @@ -553,7 +553,7 @@ testRule('xgen-IPA-112-field-names-are-camel-case', [ 'properties', 'primary_user', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-112-field-names-are-camel-case', @@ -570,7 +570,7 @@ testRule('xgen-IPA-112-field-names-are-camel-case', [ 'properties', 'REQUEST_ID', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA117DescriptionEndsWithPeriod.test.js b/tools/spectral/ipa/__tests__/IPA117DescriptionEndsWithPeriod.test.js index dc8aae98b7..0db6950607 100644 --- a/tools/spectral/ipa/__tests__/IPA117DescriptionEndsWithPeriod.test.js +++ b/tools/spectral/ipa/__tests__/IPA117DescriptionEndsWithPeriod.test.js @@ -39,7 +39,7 @@ testRule('xgen-IPA-117-description-ends-with-period', [ code: 'xgen-IPA-117-description-ends-with-period', message: 'Descriptions must end with a full stop(.).', path: ['components', 'schemas', 'Schema', 'properties', 'noPeriod'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA117DescriptionMustNotUseHtml.test.js b/tools/spectral/ipa/__tests__/IPA117DescriptionMustNotUseHtml.test.js index 71656f0272..000a895b9f 100644 --- a/tools/spectral/ipa/__tests__/IPA117DescriptionMustNotUseHtml.test.js +++ b/tools/spectral/ipa/__tests__/IPA117DescriptionMustNotUseHtml.test.js @@ -54,26 +54,26 @@ testRule('xgen-IPA-117-description-must-not-use-html', [ code: 'xgen-IPA-117-description-must-not-use-html', message: 'Descriptions must not use raw HTML.', path: ['components', 'schemas', 'Schema', 'properties', 'html'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description-must-not-use-html', message: 'Descriptions must not use raw HTML. If you want to link to additional documentation, please use the externalDocumentation property (https://swagger.io/specification/#external-documentation-object).', path: ['components', 'schemas', 'Schema', 'properties', 'link'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description-must-not-use-html', message: 'Descriptions must not use raw HTML.', path: ['components', 'schemas', 'Schema', 'properties', 'inlineHtml'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description-must-not-use-html', message: 'Descriptions must not use raw HTML.', path: ['components', 'schemas', 'Schema', 'properties', 'selfClosingHtml'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA117DescriptionShouldNotUseLinks.test.js b/tools/spectral/ipa/__tests__/IPA117DescriptionShouldNotUseLinks.test.js index 21ace0d3b4..514047183d 100644 --- a/tools/spectral/ipa/__tests__/IPA117DescriptionShouldNotUseLinks.test.js +++ b/tools/spectral/ipa/__tests__/IPA117DescriptionShouldNotUseLinks.test.js @@ -55,14 +55,14 @@ testRule('xgen-IPA-117-description-should-not-use-inline-links', [ message: 'Descriptions should not include inline links. Use the externalDocumentation property instead, see https://swagger.io/specification/#external-documentation-object.', path: ['components', 'schemas', 'Schema', 'properties', 'invalidLink'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description-should-not-use-inline-links', message: 'Descriptions should not include inline links. Use the externalDocumentation property instead, see https://swagger.io/specification/#external-documentation-object.', path: ['components', 'schemas', 'Schema', 'properties', 'invalidMultipleLinks'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA117DescriptionShouldNotUseTables.test.js b/tools/spectral/ipa/__tests__/IPA117DescriptionShouldNotUseTables.test.js index dd25fbce69..30d1439103 100644 --- a/tools/spectral/ipa/__tests__/IPA117DescriptionShouldNotUseTables.test.js +++ b/tools/spectral/ipa/__tests__/IPA117DescriptionShouldNotUseTables.test.js @@ -55,35 +55,35 @@ testRule('xgen-IPA-117-description-should-not-use-inline-tables', [ message: 'Descriptions should not include inline tables. Tables may not work well with all tools, in particular generated client code.', path: ['components', 'schemas', 'Schema', 'properties', 'table'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description-should-not-use-inline-tables', message: 'Descriptions should not include inline tables. Tables may not work well with all tools, in particular generated client code.', path: ['components', 'schemas', 'Schema', 'properties', 'tableLeftAlignment'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description-should-not-use-inline-tables', message: 'Descriptions should not include inline tables. Tables may not work well with all tools, in particular generated client code.', path: ['components', 'schemas', 'Schema', 'properties', 'tableCenterAlignment'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description-should-not-use-inline-tables', message: 'Descriptions should not include inline tables. Tables may not work well with all tools, in particular generated client code.', path: ['components', 'schemas', 'Schema', 'properties', 'tableRightAlignment'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description-should-not-use-inline-tables', message: 'Descriptions should not include inline tables. Tables may not work well with all tools, in particular generated client code.', path: ['components', 'schemas', 'Schema', 'properties', 'largeTable'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA117DescriptionStartsWithUpperCase.test.js b/tools/spectral/ipa/__tests__/IPA117DescriptionStartsWithUpperCase.test.js index 071a50ffff..5971338940 100644 --- a/tools/spectral/ipa/__tests__/IPA117DescriptionStartsWithUpperCase.test.js +++ b/tools/spectral/ipa/__tests__/IPA117DescriptionStartsWithUpperCase.test.js @@ -39,7 +39,7 @@ testRule('xgen-IPA-117-description-starts-with-uppercase', [ code: 'xgen-IPA-117-description-starts-with-uppercase', message: 'Descriptions must start with Uppercase.', path: ['components', 'schemas', 'Schema', 'properties', 'noUpperCase'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA117HasDescription.test.js b/tools/spectral/ipa/__tests__/IPA117HasDescription.test.js index 397f2902fd..f95d08792e 100644 --- a/tools/spectral/ipa/__tests__/IPA117HasDescription.test.js +++ b/tools/spectral/ipa/__tests__/IPA117HasDescription.test.js @@ -84,42 +84,42 @@ testRule('xgen-IPA-117-description', [ message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['info'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description', message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['tags', '0'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description', message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['paths', '/resource', 'get'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description', message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['paths', '/resource', 'get', 'parameters', 'id'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description', message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['components', 'schemas', 'Schema', 'properties', 'id'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description', message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['components', 'parameters', 'parameter'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -144,7 +144,7 @@ testRule('xgen-IPA-117-description', [ message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['components', 'schemas', 'Schema', 'properties', 'id'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -170,7 +170,7 @@ testRule('xgen-IPA-117-description', [ message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['components', 'schemas', 'ArraySchema', 'items', 'properties', 'id'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -198,21 +198,21 @@ testRule('xgen-IPA-117-description', [ message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['components', 'schemas', 'NestedSchema', 'properties', 'name'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description', message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['components', 'schemas', 'NestedSchema', 'properties', 'name', 'properties', 'first'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description', message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['components', 'schemas', 'NestedSchema', 'properties', 'name', 'properties', 'last'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -243,21 +243,21 @@ testRule('xgen-IPA-117-description', [ message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['components', 'schemas', 'PaginatedSchema', 'properties', 'results'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description', message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['components', 'schemas', 'PaginatedSchema', 'properties', 'results', 'items', 'properties', 'first'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description', message: 'Description not found. API producers must provide descriptions for Properties, Operations and Parameters.', path: ['components', 'schemas', 'PaginatedSchema', 'properties', 'results', 'items', 'properties', 'last'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -320,7 +320,7 @@ testRule('xgen-IPA-117-description', [ 'properties', 'id', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description', @@ -337,7 +337,7 @@ testRule('xgen-IPA-117-description', [ 'properties', 'id', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, { code: 'xgen-IPA-117-description', @@ -354,7 +354,7 @@ testRule('xgen-IPA-117-description', [ 'properties', 'id', ], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA125OneOfMustHaveDiscriminator.test.js b/tools/spectral/ipa/__tests__/IPA125OneOfMustHaveDiscriminator.test.js index 79a8f074e4..8a3e411574 100644 --- a/tools/spectral/ipa/__tests__/IPA125OneOfMustHaveDiscriminator.test.js +++ b/tools/spectral/ipa/__tests__/IPA125OneOfMustHaveDiscriminator.test.js @@ -79,7 +79,7 @@ testRule('xgen-IPA-125-oneOf-must-have-discriminator', [ message: 'The discriminator mapping must match the oneOf references. Unmatched Discriminator mappings with oneOf references: #/components/schemas/Bird', path: ['components', 'schemas', 'Animal'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -100,7 +100,7 @@ testRule('xgen-IPA-125-oneOf-must-have-discriminator', [ code: 'xgen-IPA-125-oneOf-must-have-discriminator', message: 'The schema has oneOf but no discriminator property.', path: ['components', 'schemas', 'Animal'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -122,7 +122,7 @@ testRule('xgen-IPA-125-oneOf-must-have-discriminator', [ code: 'xgen-IPA-125-oneOf-must-have-discriminator', message: 'Discriminator property is not an object.', path: ['components', 'schemas', 'Animal'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -149,7 +149,7 @@ testRule('xgen-IPA-125-oneOf-must-have-discriminator', [ code: 'xgen-IPA-125-oneOf-must-have-discriminator', message: 'Discriminator has no propertyName defined.', path: ['components', 'schemas', 'Animal'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -173,7 +173,7 @@ testRule('xgen-IPA-125-oneOf-must-have-discriminator', [ code: 'xgen-IPA-125-oneOf-must-have-discriminator', message: 'Discriminator must have a mapping object.', path: ['components', 'schemas', 'Animal'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/__tests__/IPA125OneOfNoBaseTypes.test.js b/tools/spectral/ipa/__tests__/IPA125OneOfNoBaseTypes.test.js index 24867dfee1..ef5828fa0b 100644 --- a/tools/spectral/ipa/__tests__/IPA125OneOfNoBaseTypes.test.js +++ b/tools/spectral/ipa/__tests__/IPA125OneOfNoBaseTypes.test.js @@ -72,7 +72,7 @@ testRule('xgen-IPA-125-oneOf-no-base-types', [ code: 'xgen-IPA-125-oneOf-no-base-types', message: 'oneOf should not mix base types with references.', path: ['components', 'schemas', 'MixedType'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, @@ -93,7 +93,7 @@ testRule('xgen-IPA-125-oneOf-no-base-types', [ code: 'xgen-IPA-125-oneOf-no-base-types', message: 'oneOf should not contain multiple different base types.', path: ['components', 'schemas', 'BaseTypes'], - severity: DiagnosticSeverity.Warning, + severity: DiagnosticSeverity.Error, }, ], }, diff --git a/tools/spectral/ipa/ipa-spectral.yaml b/tools/spectral/ipa/ipa-spectral.yaml index 50fa4ea782..e45c7540fa 100644 --- a/tools/spectral/ipa/ipa-spectral.yaml +++ b/tools/spectral/ipa/ipa-spectral.yaml @@ -56,3 +56,56 @@ overrides: - '**#/paths/~1rest~1unauth~1version' # external reference, to be covered by CLOUDP-309694 rules: xgen-IPA-114-error-responses-refer-to-api-error: 'off' + - files: + - '**#/paths/~1api~1atlas~1v2~1groups~1%7BgroupId%7D~1clusters~1%7BclusterName%7D~1%7BclusterView%7D~1%7BdatabaseName%7D~1%7BcollectionName%7D~1collStats~1measurements' # reference to support future investigation - CLOUDP-310775 + - '**#/paths/~1api~1atlas~1v2~1groups~1%7BgroupId%7D~1processes~1%7BprocessId%7D~1%7BdatabaseName%7D~1%7BcollectionName%7D~1collStats~1measurements' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/HostMetricValue' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/DefaultEventViewForOrg' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AlertsThresholdInteger' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AppServiceMetricThreshold' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/FlexClusterMetricThreshold' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/HostMetricThreshold' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/ServerlessMetricThreshold' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/StreamProcessorMetricThreshold' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AWSKMSConfiguration/properties/region' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AWSKMSEARPrivateEndpoint/properties/regionName/oneOf/0' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AWSKMSEARPrivateEndpoint/properties/regionName/oneOf/1' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AzureKeyVaultEARPrivateEndpoint/properties/regionName/oneOf/0' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AzureKeyVaultEARPrivateEndpoint/properties/regionName/oneOf/1' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/EARPrivateEndpoint/properties/regionName/oneOf/0' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/EARPrivateEndpoint/properties/regionName/oneOf/1' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AWSHardwareSpec20240805/properties/instanceSize' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AzureHardwareSpec20240805/properties/instanceSize' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/CloudRegionConfig20240805/properties/regionName/oneOf/0' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/CloudRegionConfig20240805/properties/regionName/oneOf/1' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/CloudRegionConfig20240805/properties/regionName/oneOf/2' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/ApiSearchDeploymentSpecView/properties/instanceSize' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AWSCloudProviderContainer/allOf/1/properties/regionName' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AzureCloudProviderContainer/allOf/1/properties/region' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/GCPCloudProviderContainer/allOf/1/properties/regions/items' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/DatabasePrivilegeAction/properties/action' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AWSCloudProviderSettings/allOf/1/properties/instanceSizeName' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AWSCloudProviderSettings/allOf/1/properties/regionName' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AWSComputeAutoScaling/properties/maxInstanceSize' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AWSComputeAutoScaling/properties/minInstanceSize' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AzureCloudProviderSettings/allOf/1/properties/instanceSizeName' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AzureCloudProviderSettings/allOf/1/properties/regionName' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AzureComputeAutoScalingRules/properties/maxInstanceSize' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AzureComputeAutoScalingRules/properties/minInstanceSize' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/CloudGCPProviderSettings/allOf/1/properties/regionName' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AWSHardwareSpec/properties/instanceSize' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/AzureHardwareSpec/properties/instanceSize' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/CloudRegionConfig/properties/regionName/oneOf/0' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/CloudRegionConfig/properties/regionName/oneOf/1' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/CloudRegionConfig/properties/regionName/oneOf/2' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/InvoiceLineItem/properties/sku' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/Collation/properties/locale' # reference to support future investigation - CLOUDP-310775 + - '**#/components/schemas/tokenFiltersnowballStemming/properties/stemmerName' # external field, to be covered by CLOUDP-293178 + - '**#/components/schemas/DataLakeS3StoreSettings/allOf/1/properties/region' # external field, to be covered by CLOUDP-293178 + - '**#/components/schemas/DataLakeDLSAWSStore/allOf/1/properties/region' # external field, to be covered by CLOUDP-293178 + - '**#/components/schemas/DataLakeDLSAzureStore/allOf/1/properties/region' # external field, to be covered by CLOUDP-293178 + - '**#/components/schemas/DataLakeAzureBlobStore/allOf/1/properties/region' # external field, to be covered by CLOUDP-293178 + - '**#/components/schemas/DataLakeGoogleCloudStorageStore/allOf/1/properties/region' # external field, to be covered by CLOUDP-293178 + - '**#/components/schemas/DataLakeDLSGCPStore/allOf/1/properties/region' # external field, to be covered by CLOUDP-293178 + rules: + xgen-IPA-123-allowable-enum-values-should-not-exceed-20: 'off' diff --git a/tools/spectral/ipa/rulesets/IPA-110.yaml b/tools/spectral/ipa/rulesets/IPA-110.yaml index 22702e9995..155084df6e 100644 --- a/tools/spectral/ipa/rulesets/IPA-110.yaml +++ b/tools/spectral/ipa/rulesets/IPA-110.yaml @@ -20,7 +20,7 @@ rules: - Checks if List method has a response schema defined - Checks that the 200 response schema references a schema with a "Paginated" prefix message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-110-collections-use-paginated-prefix' - severity: warn + severity: error given: '$.paths[*].get.responses.200.content' then: field: '@key' @@ -34,7 +34,7 @@ rules: - Only applies to List methods (GET operations that return collections of resources) - Verifies the 200 response schema has the required results fields message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-110-collections-response-define-results-array' - severity: warn + severity: error given: '$.paths[*].get.responses.200.content' then: field: '@key' @@ -52,7 +52,7 @@ rules: - Verifies the itemsPerPage query parameter is not required - Verifies the itemsPerPage query parameter has a default value of 100 message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-110-collections-request-has-itemsPerPage-query-param' - severity: warn + severity: error given: '$.paths[*].get' then: function: 'IPA110CollectionsRequestHasItemsPerPageQueryParam' @@ -69,7 +69,7 @@ rules: - Verifies the pageNum query parameter is not required - Verifies the pageNum query parameter has a default value of 1 message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-110-collections-request-has-pageNum-query-param' - severity: warn + severity: error given: '$.paths[*].get' then: function: 'IPA110CollectionsRequestHasPageNumQueryParam' @@ -83,7 +83,7 @@ rules: - Checks if includeCount query parameter exists - If it exists, verifies the includeCount parameter is not required message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-110-collections-request-includeCount-not-required' - severity: warn + severity: error given: '$.paths[*].get' then: function: 'IPA110CollectionsRequestIncludeCountNotRequired' @@ -96,7 +96,7 @@ rules: - Only applies to List methods (GET operations that return collections of resources) - Verifies the response schema includes a links field of type array message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-110-collections-response-define-links-array' - severity: warn + severity: error given: '$.paths[*].get.responses.200.content' then: field: '@key' diff --git a/tools/spectral/ipa/rulesets/IPA-112.yaml b/tools/spectral/ipa/rulesets/IPA-112.yaml index b2f11ebe90..c923574917 100644 --- a/tools/spectral/ipa/rulesets/IPA-112.yaml +++ b/tools/spectral/ipa/rulesets/IPA-112.yaml @@ -19,7 +19,7 @@ rules: - Reports any instances where these field names are used - Suggests using "group", "groups", or "groupId" as alternatives message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-112-avoid-project-field-names' - severity: warn + severity: error resolved: false given: - '$.components.schemas..properties' @@ -46,7 +46,7 @@ rules: - Identifies property names that are not in camelCase format - Reports any instances where these field names are not in camelCase format message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-112-field-names-are-camel-case' - severity: warn + severity: error resolved: false given: - '$.components.schemas..properties' @@ -65,7 +65,7 @@ rules: - Identifies property names that start with "is" followed by an uppercase letter - Suggests using the direct adjective form instead (e.g., "disabled" instead of "isDisabled") message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-112-boolean-field-names-avoid-is-prefix' - severity: warn + severity: error resolved: false given: - '$.components.schemas..properties' diff --git a/tools/spectral/ipa/rulesets/IPA-117.yaml b/tools/spectral/ipa/rulesets/IPA-117.yaml index 15f6d428eb..a5cec7956a 100644 --- a/tools/spectral/ipa/rulesets/IPA-117.yaml +++ b/tools/spectral/ipa/rulesets/IPA-117.yaml @@ -27,7 +27,7 @@ rules: - Schema properties The rule also fails if the description is an empty string. message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-description' - severity: warn + severity: error given: - '$.info' - '$.tags[*]' @@ -51,7 +51,7 @@ rules: - Parameter objects (in operations and components) - Schema properties message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-description-starts-with-uppercase' - severity: warn + severity: error given: - '$.info' - '$.tags[*]' @@ -76,7 +76,7 @@ rules: - Schema properties The rule ignores descriptions that end with `|`, i.e. inline markdown tables message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-description-ends-with-period' - severity: warn + severity: error given: - '$.info' - '$.tags[*]' @@ -101,7 +101,7 @@ rules: - Schema properties The rule validates that the description content does not include opening and/or closing HTML tags. message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-description-must-not-use-html' - severity: warn + severity: error given: - '$.info' - '$.tags[*]' @@ -126,7 +126,7 @@ rules: - Schema properties The rule validates that the description content does not include inline markdown tables. message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-description-should-not-use-inline-tables' - severity: warn + severity: error given: - '$.info' - '$.tags[*]' @@ -150,7 +150,7 @@ rules: - Schema properties The rule validates that the description content does not include inline markdown links. The rule ignores HTML `` links - this is covered by `xgen-IPA-117-description-must-not-use-html`. message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-117-description-should-not-use-inline-links' - severity: warn + severity: error given: - '$.tags[*]' - '$.paths[*][get,put,post,delete,options,head,patch,trace]' diff --git a/tools/spectral/ipa/rulesets/IPA-125.yaml b/tools/spectral/ipa/rulesets/IPA-125.yaml index 0de89e318d..35241acf4e 100644 --- a/tools/spectral/ipa/rulesets/IPA-125.yaml +++ b/tools/spectral/ipa/rulesets/IPA-125.yaml @@ -36,7 +36,7 @@ rules: This is valid because there are exactly 2 mappings for 2 oneOf references, and all values match. message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-125-oneOf-must-have-discriminator' - severity: warn + severity: error given: '$.components.schemas[*]' then: function: 'IPA125OneOfMustHaveDiscriminator' @@ -59,7 +59,7 @@ rules: object types with clear discriminators. message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-125-oneOf-no-base-types' - severity: warn + severity: error given: '$.components.schemas[*]' then: function: 'IPA125OneOfNoBaseTypes' diff --git a/tools/spectral/ipa/rulesets/README.md b/tools/spectral/ipa/rulesets/README.md index e828145239..7038d47085 100644 --- a/tools/spectral/ipa/rulesets/README.md +++ b/tools/spectral/ipa/rulesets/README.md @@ -441,7 +441,7 @@ Rules are based on [http://go/ipa/IPA-110](http://go/ipa/IPA-110). #### xgen-IPA-110-collections-use-paginated-prefix - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) APIs that return collections of resources must use a schema with the "Paginated" prefix. ##### Implementation details @@ -452,7 +452,7 @@ Rule checks for the following conditions: #### xgen-IPA-110-collections-response-define-results-array - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) The response for collections must define an array of results containing the paginated resource. ##### Implementation details @@ -462,7 +462,7 @@ Rule checks for the following conditions: #### xgen-IPA-110-collections-request-has-itemsPerPage-query-param - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) The request should support an integer itemsPerPage query parameter allowing users to specify the maximum number of results to return per page. itemsPerPage must not be required itemsPerPage default value should be 100. @@ -476,7 +476,7 @@ Rule checks for the following conditions: #### xgen-IPA-110-collections-request-has-pageNum-query-param - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) The request should support an integer pageNum query parameter allowing users to specify the maximum number of results to return per page. pageNum must not be required pageNum default value should be 1. @@ -490,7 +490,7 @@ Rule checks for the following conditions: #### xgen-IPA-110-collections-request-includeCount-not-required - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) If the request supports an includeCount query parameter, it must not be required. ##### Implementation details @@ -501,7 +501,7 @@ Rule checks for the following conditions: #### xgen-IPA-110-collections-response-define-links-array - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) The response for collections should define a links array field, providing links to next and previous pages. ##### Implementation details @@ -517,7 +517,7 @@ Rules are based on [http://go/ipa/IPA-112](http://go/ipa/IPA-112). #### xgen-IPA-112-avoid-project-field-names - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) Schema field names should avoid using "project", "projects", or "projectId". ##### Implementation details @@ -530,7 +530,7 @@ Rule checks for the following conditions: #### xgen-IPA-112-field-names-are-camel-case - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) Schema field names should be in camelCase format. ##### Implementation details @@ -541,7 +541,7 @@ Rule checks for the following conditions: #### xgen-IPA-112-boolean-field-names-avoid-is-prefix - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) Boolean field names should avoid the "is" prefix. ##### Implementation details @@ -642,7 +642,7 @@ Rules are based on [http://go/ipa/IPA-117](http://go/ipa/IPA-117). #### xgen-IPA-117-description - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) API producers must provide descriptions for Properties, Operations and Parameters. ##### Implementation details @@ -657,7 +657,7 @@ The rule also fails if the description is an empty string. #### xgen-IPA-117-description-starts-with-uppercase - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) Descriptions must start with Uppercase. ##### Implementation details @@ -671,7 +671,7 @@ Rule checks the format of the description property in the following components: #### xgen-IPA-117-description-ends-with-period - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) Descriptions must end with a full stop(.). ##### Implementation details @@ -686,7 +686,7 @@ The rule ignores descriptions that end with `|`, i.e. inline markdown tables #### xgen-IPA-117-description-must-not-use-html - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) Descriptions must not use raw HTML. ##### Implementation details @@ -701,7 +701,7 @@ The rule validates that the description content does not include opening and/or #### xgen-IPA-117-description-should-not-use-inline-tables - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) Descriptions should not include inline tables as this may not work well with all tools, in particular generated client code. ##### Implementation details @@ -716,7 +716,7 @@ The rule validates that the description content does not include inline markdown #### xgen-IPA-117-description-should-not-use-inline-links - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) Descriptions should not include inline links. ##### Implementation details @@ -850,7 +850,7 @@ Rules are based on [http://go/ipa/IPA-125](http://go/ipa/IPA-125). #### xgen-IPA-125-oneOf-must-have-discriminator - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) Each oneOf property must include a discriminator property to define the exact type. ##### Implementation details @@ -880,7 +880,7 @@ Rule checks for the following conditions: #### xgen-IPA-125-oneOf-no-base-types - ![warn](https://img.shields.io/badge/warning-yellow) + ![error](https://img.shields.io/badge/error-red) API producers should not use oneOf with different base types like integer, string, boolean, or number or references at the same time. ##### Implementation details