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
7 changes: 4 additions & 3 deletions .github/workflows/spectral-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ name: Spectral Lint Commited OpenAPI Spec
# Trigger the workflow on pull requests and pushes to the main branch
on:
pull_request:
paths:
paths:
- 'tools/spectral/**'
- 'openapi/**.yaml'
- 'package.json'
push:
branches:
- main
paths:
paths:
- 'tools/spectral/**'
- 'openapi/**.yaml'
- 'package.json'

jobs:
spectral-lint:
runs-on: ubuntu-latest

steps:
# Checkout the code
- name: Checkout repository
Expand Down Expand Up @@ -48,3 +48,4 @@ jobs:
with:
file_glob: v2.yaml
spectral_ruleset: tools/spectral/ipa/ipa-spectral.yaml

Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,37 @@ testRule('xgen-IPA-102-path-alternate-resource-name-path-param', [
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/resourceName1/resourceName2'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/resourceName/{pathParam1}/{pathParam2}'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/resourceName1/{pathParam1}/resourceName2/resourceName3'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/resourceName1/{pathParam1}/resourceName2/{pathParam2}/{pathParam3}'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/{pathParam}'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/{pathParam1}/{pathParam2}'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand All @@ -100,37 +100,37 @@ testRule('xgen-IPA-102-path-alternate-resource-name-path-param', [
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/unauth/resourceName1/resourceName2'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/unauth/resourceName/{pathParam1}/{pathParam2}'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/unauth/resourceName1/{pathParam1}/resourceName2/resourceName3'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/unauth/resourceName1/{pathParam1}/resourceName2/{pathParam2}/{pathParam3}'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/unauth/{pathParam}'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-102-path-alternate-resource-name-path-param',
message: 'API paths must alternate between resource name and path params.',
path: ['paths', '/api/atlas/v2/unauth/{pathParam1}/{pathParam2}'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,31 +94,31 @@ testRule('xgen-IPA-104-resource-has-GET', [
code: 'xgen-IPA-104-resource-has-GET',
message: 'APIs must provide a get method for resources.',
path: ['paths', '/standard'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-resource-has-GET',
message: 'APIs must provide a get method for resources.',
path: ['paths', '/standard/{exampleId}/nested'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-resource-has-GET',
message: 'APIs must provide a get method for resources.',
path: ['paths', '/standard/{exampleId}/nestedSingleton'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-resource-has-GET',
message: 'APIs must provide a get method for resources.',
path: ['paths', '/custom'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-resource-has-GET',
message: 'APIs must provide a get method for resources.',
path: ['paths', '/standardWithoutSubResource'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ testRule('xgen-IPA-104-get-method-no-request-body', [
code: 'xgen-IPA-104-get-method-no-request-body',
message: 'The Get method must not include a request body.',
path: ['paths', '/resource/{id}', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-get-method-no-request-body',
message: 'The Get method must not include a request body.',
path: ['paths', '/resource/{id}/singleton', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ testRule('xgen-IPA-104-get-method-response-has-no-input-fields', [
'content',
'application/vnd.atlas.2024-08-05+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-get-method-response-has-no-input-fields',
Expand All @@ -156,7 +156,7 @@ testRule('xgen-IPA-104-get-method-response-has-no-input-fields', [
'content',
'application/vnd.atlas.2024-08-05+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ testRule('xgen-IPA-104-get-method-returns-response-suffixed-object', [
'content',
'application/vnd.atlas.2023-01-01+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-get-method-returns-response-suffixed-object',
Expand All @@ -176,7 +176,7 @@ testRule('xgen-IPA-104-get-method-returns-response-suffixed-object', [
'content',
'application/vnd.atlas.2024-01-01+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-get-method-returns-response-suffixed-object',
Expand All @@ -190,7 +190,7 @@ testRule('xgen-IPA-104-get-method-returns-response-suffixed-object', [
'content',
'application/vnd.atlas.2025-01-01+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-get-method-returns-response-suffixed-object',
Expand All @@ -204,7 +204,7 @@ testRule('xgen-IPA-104-get-method-returns-response-suffixed-object', [
'content',
'application/vnd.atlas.2024-08-05+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ testRule('xgen-IPA-104-get-method-returns-single-resource', [
'content',
'application/vnd.atlas.2024-08-05+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-get-method-returns-single-resource',
Expand All @@ -189,7 +189,7 @@ testRule('xgen-IPA-104-get-method-returns-single-resource', [
'content',
'application/vnd.atlas.2024-08-05+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-get-method-returns-single-resource',
Expand All @@ -204,7 +204,7 @@ testRule('xgen-IPA-104-get-method-returns-single-resource', [
'content',
'application/vnd.atlas.2024-08-05+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-get-method-returns-single-resource',
Expand All @@ -219,7 +219,7 @@ testRule('xgen-IPA-104-get-method-returns-single-resource', [
'content',
'application/vnd.atlas.2024-08-05+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,28 @@ testRule('xgen-IPA-104-get-method-response-code-is-200', [
message:
'The Get method must return a 200 OK response. This method either lacks a 200 OK response or defines a different 2xx status code.',
path: ['paths', '/resourceOne/{id}', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-get-method-response-code-is-200',
message:
'The Get method must return a 200 OK response. This method either lacks a 200 OK response or defines a different 2xx status code.',
path: ['paths', '/resourceTwo/{id}', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-get-method-response-code-is-200',
message:
'The Get method must return a 200 OK response. This method either lacks a 200 OK response or defines a different 2xx status code.',
path: ['paths', '/resourceThree/{id}', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-104-get-method-response-code-is-200',
message:
'The Get method must return a 200 OK response. This method either lacks a 200 OK response or defines a different 2xx status code.',
path: ['paths', '/resource/{id}/singleton', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ testRule('xgen-IPA-105-resource-has-list', [
code: 'xgen-IPA-105-resource-has-list',
message: 'APIs must provide a List method for resources.',
path: ['paths', '/standard'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-105-resource-has-list',
message: 'APIs must provide a List method for resources.',
path: ['paths', '/standard/{exampleId}/nested'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ testRule('xgen-IPA-105-list-method-no-request-body', [
code: 'xgen-IPA-105-list-method-no-request-body',
message: 'The List method must not include a request body.',
path: ['paths', '/resource', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ testRule('xgen-IPA-105-list-method-response-is-get-method-response', [
message:
'The schema of each result in the List method response must be the same schema as the response of the Get method.',
path: ['paths', '/resource', 'get', 'responses', '200', 'content', 'application/vnd.atlas.2024-08-05+json'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-105-list-method-response-is-get-method-response',
Expand All @@ -415,14 +415,14 @@ testRule('xgen-IPA-105-list-method-response-is-get-method-response', [
'content',
'application/vnd.atlas.2024-08-05+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-105-list-method-response-is-get-method-response',
message:
'Could not validate that the List method returns the same resource object as the Get method. The Get method does not have a schema.',
path: ['paths', '/resourceTwo', 'get', 'responses', '200', 'content', 'application/vnd.atlas.2024-01-05+json'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-105-list-method-response-is-get-method-response',
Expand All @@ -437,7 +437,7 @@ testRule('xgen-IPA-105-list-method-response-is-get-method-response', [
'content',
'application/vnd.atlas.2024-01-05+json',
],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down Expand Up @@ -484,7 +484,7 @@ testRule('xgen-IPA-105-list-method-response-is-get-method-response', [
message:
'The schema of each result in the List method response must be the same schema as the response of the Get method.',
path: ['paths', '/resource', 'get', 'responses', '200', 'content', 'application/vnd.atlas.2024-08-05+json'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,28 +83,28 @@ testRule('xgen-IPA-105-list-method-response-code-is-200', [
message:
'The List method must return a 200 OK response. This method either lacks a 200 OK response or defines a different 2xx status code.',
path: ['paths', '/resourceOne', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-105-list-method-response-code-is-200',
message:
'The List method must return a 200 OK response. This method either lacks a 200 OK response or defines a different 2xx status code.',
path: ['paths', '/resourceTwo', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-105-list-method-response-code-is-200',
message:
'The List method must return a 200 OK response. This method either lacks a 200 OK response or defines a different 2xx status code.',
path: ['paths', '/resourceThree', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
{
code: 'xgen-IPA-105-list-method-response-code-is-200',
message:
'The List method must return a 200 OK response. This method either lacks a 200 OK response or defines a different 2xx status code.',
path: ['paths', '/resourceFour', 'get'],
severity: DiagnosticSeverity.Warning,
severity: DiagnosticSeverity.Error,
},
],
},
Expand Down
Loading
Loading