Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ testRule('xgen-IPA-114-api-error-has-bad-request-detail', [
code: 'xgen-IPA-114-api-error-has-bad-request-detail',
message: 'ApiError schema must have badRequestDetail field.',
path: ['components', 'schemas', 'ApiError'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand All @@ -75,7 +75,7 @@ testRule('xgen-IPA-114-api-error-has-bad-request-detail', [
code: 'xgen-IPA-114-api-error-has-bad-request-detail',
message: 'ApiError schema must have badRequestDetail field.',
path: ['components', 'schemas', 'ApiError'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand All @@ -101,7 +101,7 @@ testRule('xgen-IPA-114-api-error-has-bad-request-detail', [
code: 'xgen-IPA-114-api-error-has-bad-request-detail',
message: 'badRequestDetail must include an array of fields.',
path: ['components', 'schemas', 'ApiError'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -129,7 +129,7 @@ testRule('xgen-IPA-114-api-error-has-bad-request-detail', [
code: 'xgen-IPA-114-api-error-has-bad-request-detail',
message: 'badRequestDetail must include an array of fields.',
path: ['components', 'schemas', 'ApiError'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -161,7 +161,7 @@ testRule('xgen-IPA-114-api-error-has-bad-request-detail', [
code: 'xgen-IPA-114-api-error-has-bad-request-detail',
message: 'Each field must include description and field properties.',
path: ['components', 'schemas', 'ApiError'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ testRule('xgen-IPA-114-authenticated-endpoints-have-auth-errors', [
code: 'xgen-IPA-114-authenticated-endpoints-have-auth-errors',
message: 'Authenticated endpoint must define a 401 response.',
path: ['paths', '/resources', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-114-authenticated-endpoints-have-auth-errors',
message: 'Authenticated endpoint must define a 403 response.',
path: ['paths', '/resources', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand All @@ -66,7 +66,7 @@ testRule('xgen-IPA-114-authenticated-endpoints-have-auth-errors', [
code: 'xgen-IPA-114-authenticated-endpoints-have-auth-errors',
message: 'Authenticated endpoint must define a 401 response.',
path: ['paths', '/resources', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand All @@ -89,7 +89,7 @@ testRule('xgen-IPA-114-authenticated-endpoints-have-auth-errors', [
code: 'xgen-IPA-114-authenticated-endpoints-have-auth-errors',
message: 'Authenticated endpoint must define a 403 response.',
path: ['paths', '/resources', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -154,7 +154,7 @@ testRule('xgen-IPA-114-authenticated-endpoints-have-auth-errors', [
code: 'xgen-IPA-114-authenticated-endpoints-have-auth-errors',
message: 'Authenticated endpoint must define a 401 and 403 responses.',
path: ['paths', '/resources', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ testRule('xgen-IPA-114-error-responses-refer-to-api-error', [
code: 'xgen-IPA-114-error-responses-refer-to-api-error',
message: '400 response must define a schema referencing ApiError.',
path: ['paths', '/resources', 'get', 'responses', '400', 'content', 'application/json'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand All @@ -115,7 +115,7 @@ testRule('xgen-IPA-114-error-responses-refer-to-api-error', [
code: 'xgen-IPA-114-error-responses-refer-to-api-error',
message: '400 response must define content with ApiError schema reference.',
path: ['paths', '/resources', 'get', 'responses', '400'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -157,7 +157,7 @@ testRule('xgen-IPA-114-error-responses-refer-to-api-error', [
code: 'xgen-IPA-114-error-responses-refer-to-api-error',
message: '500 response must reference ApiError schema.',
path: ['paths', '/resources', 'get', 'responses', '500', 'content', 'application/json'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -192,7 +192,7 @@ testRule('xgen-IPA-114-error-responses-refer-to-api-error', [
code: 'xgen-IPA-114-error-responses-refer-to-api-error',
message: '404 response must reference ApiError schema.',
path: ['paths', '/resources', 'get', 'responses', '404', 'content', 'application/json'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ testRule('xgen-IPA-114-parameterized-paths-have-404-not-found', [
code: 'xgen-IPA-114-parameterized-paths-have-404-not-found',
message: 'Parameterized path must define a 404 response.',
path: ['paths', '/resources/{resourceId}', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -85,7 +85,7 @@ testRule('xgen-IPA-114-parameterized-paths-have-404-not-found', [
code: 'xgen-IPA-114-parameterized-paths-have-404-not-found',
message: 'Parameterized path must define a 404 response.',
path: ['paths', '/resources/{resourceId}', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ testRule('xgen-IPA-117-objects-must-be-well-defined', [
'content',
'application/vnd.atlas.2024-08-05+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-117-objects-must-be-well-defined',
Expand All @@ -190,7 +190,7 @@ testRule('xgen-IPA-117-objects-must-be-well-defined', [
'properties',
'name',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-117-objects-must-be-well-defined',
Expand All @@ -208,42 +208,42 @@ testRule('xgen-IPA-117-objects-must-be-well-defined', [
'hobbies',
'items',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-117-objects-must-be-well-defined',
message:
'Components of type "object" must be well-defined with for example a schema, example(s) or properties.',
path: ['paths', '/resource/{id}', 'get', 'requestBody', 'content', 'application/vnd.atlas.2023-08-05+json'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-117-objects-must-be-well-defined',
message:
'Components of type "object" must be well-defined with for example a schema, example(s) or properties.',
path: ['components', 'schemas', 'SchemaOneOf'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-117-objects-must-be-well-defined',
message:
'Components of type "object" must be well-defined with for example a schema, example(s) or properties.',
path: ['components', 'schemas', 'SchemaAllOf'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-117-objects-must-be-well-defined',
message:
'Components of type "object" must be well-defined with for example a schema, example(s) or properties.',
path: ['components', 'schemas', 'SchemaAnyOf'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-117-objects-must-be-well-defined',
message:
'Components of type "object" must be well-defined with for example a schema, example(s) or properties.',
path: ['components', 'schemas', 'ArraySchema', 'items'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -279,7 +279,7 @@ testRule('xgen-IPA-117-objects-must-be-well-defined', [
message:
'Components of type "object" must be well-defined with for example a schema, example(s) or properties.',
path: ['components', 'schemas', 'Schema'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ testRule('xgen-IPA-117-parameter-has-examples-or-schema', [
code: 'xgen-IPA-117-parameter-has-examples-or-schema',
message: 'API producers must provide a well-defined schema or example(s) for parameters.',
path: ['paths', '/resource/{id}', 'get', 'parameters', '0'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-117-parameter-has-examples-or-schema',
message: 'API producers must provide a well-defined schema or example(s) for parameters.',
path: ['components', 'parameters', 'id'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ testRule('xgen-IPA-117-plaintext-response-must-have-example', [
code: 'xgen-IPA-117-plaintext-response-must-have-example',
message: 'For APIs that respond with plain text, for example CSV, API producers must provide an example.',
path: ['paths', '/resource', 'get', 'responses', '200', 'content', 'application/vnd.atlas.2022-01-01+csv'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-117-plaintext-response-must-have-example',
message: 'For APIs that respond with plain text, for example CSV, API producers must provide an example.',
path: ['paths', '/resource', 'get', 'responses', '200', 'content', 'application/vnd.atlas.2023-01-01+csv'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-117-plaintext-response-must-have-example',
message: 'For APIs that respond with plain text, for example CSV, API producers must provide an example.',
path: ['paths', '/resource', 'get', 'responses', '200', 'content', 'text/plain'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ testRule('xgen-IPA-118-no-additional-properties-false', [
message:
"Schema must not use 'additionalProperties: false'. Consider using 'additionalProperties: true' or omitting the property.",
path: ['components', 'schemas', 'ExampleSchema'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -112,7 +112,7 @@ testRule('xgen-IPA-118-no-additional-properties-false', [
message:
"Schema must not use 'additionalProperties: false'. Consider using 'additionalProperties: true' or omitting the property.",
path: ['components', 'schemas', 'ParentSchema', 'properties', 'child'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -143,14 +143,14 @@ testRule('xgen-IPA-118-no-additional-properties-false', [
message:
"Schema must not use 'additionalProperties: false'. Consider using 'additionalProperties: true' or omitting the property.",
path: ['components', 'schemas', 'ParentSchema'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-118-no-additional-properties-false',
message:
"Schema must not use 'additionalProperties: false'. Consider using 'additionalProperties: true' or omitting the property.",
path: ['components', 'schemas', 'ParentSchema', 'properties', 'child'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ testRule('xgen-IPA-119-no-default-for-cloud-providers', [
code: 'xgen-IPA-119-no-default-for-cloud-providers',
message: 'When using a provider field or param, API producers should not define a default value.',
path: ['components', 'schemas', 'Schema', 'properties', 'cloudProvider'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand All @@ -68,7 +68,7 @@ testRule('xgen-IPA-119-no-default-for-cloud-providers', [
code: 'xgen-IPA-119-no-default-for-cloud-providers',
message: 'When using a provider field or param, API producers should not define a default value.',
path: ['components', 'schemas', 'Schema', 'properties', 'provider'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -137,7 +137,7 @@ testRule('xgen-IPA-119-no-default-for-cloud-providers', [
code: 'xgen-IPA-119-no-default-for-cloud-providers',
message: 'When using a provider field or param, API producers should not define a default value.',
path: ['paths', '/resources', 'get', 'parameters', '0'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,21 @@ testRule('xgen-IPA-121-date-time-fields-mention-iso-8601', [
message:
'API producers must use ISO 8601 date-time format in UTC for all timestamps. Fields must note ISO 8601 and UTC in their description.',
path: ['components', 'schemas', 'TestSchema', 'properties', 'createdAt'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-121-date-time-fields-mention-iso-8601',
message:
'API producers must use ISO 8601 date-time format in UTC for all timestamps. Fields must note ISO 8601 and UTC in their description.',
path: ['components', 'schemas', 'TestSchema', 'properties', 'modifiedAt'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-121-date-time-fields-mention-iso-8601',
message:
'API producers must use ISO 8601 date-time format in UTC for all timestamps. Fields must note ISO 8601 and UTC in their description.',
path: ['components', 'parameters', 'TestParameter'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -204,7 +204,7 @@ testRule('xgen-IPA-121-date-time-fields-mention-iso-8601', [
message:
'API producers must use ISO 8601 date-time format in UTC for all timestamps. Fields must note ISO 8601 and UTC in their description.',
path: ['paths', '/resources', 'get', 'parameters', '1'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -254,7 +254,7 @@ testRule('xgen-IPA-121-date-time-fields-mention-iso-8601', [
'properties',
'expiresAt',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ testRule('xgen-IPA-123-allowable-enum-values-should-not-exceed-20', [
code: 'xgen-IPA-123-allowable-enum-values-should-not-exceed-20',
message: 'Inline enum arrays should not exceed 20 values. Current count: 21',
path: ['components', 'schemas', 'TestSchema', 'properties', 'status', 'enum'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -174,7 +174,7 @@ testRule('xgen-IPA-123-allowable-enum-values-should-not-exceed-20', [
code: 'xgen-IPA-123-allowable-enum-values-should-not-exceed-20',
message: 'Inline enum arrays should not exceed 20 values. Current count: 21',
path: ['components', 'schemas', 'TestSchema', 'properties', 'priority', 'enum'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -247,7 +247,7 @@ testRule('xgen-IPA-123-allowable-enum-values-should-not-exceed-20', [
code: 'xgen-IPA-123-allowable-enum-values-should-not-exceed-20',
message: 'Inline enum arrays should not exceed 20 values. Current count: 21',
path: ['paths', '/resources', 'get', 'parameters', '0', 'schema', 'enum'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Loading
Loading