diff --git a/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-2-0.yaml b/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-2-0.yaml index 4da1a304a4..c3ec80bfb4 100644 --- a/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-2-0.yaml +++ b/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-2-0.yaml @@ -2,11 +2,21 @@ swagger: '2.0' info: title: Foo version: 0.1.0 +parameters: + test_id: + name: test_id + in: path + required: true + type: string + schema: + type: string + format: uuid + title: Test Id paths: /foo/{bar_id}: delete: - summary: Delete foo bar id - operationId: deleteFooBar + summary: Delete bar id + operationId: deleteBar responses: '200': description: Successful Response diff --git a/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-3-0.yaml b/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-3-0.yaml index f81f343e96..35837bb26d 100644 --- a/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-3-0.yaml +++ b/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-3-0.yaml @@ -2,11 +2,21 @@ openapi: 3.0.0 info: title: Foo version: 0.1.0 +components: + parameters: + test_id: + name: test_id + in: path + required: true + schema: + type: string + format: uuid + title: Test Id paths: /foo/{bar_id}: delete: - summary: Delete foo bar id - operationId: deleteFooBar + summary: Delete bar id + operationId: deleteBar responses: '200': description: Successful Response @@ -28,3 +38,37 @@ paths: type: string format: uuid title: Bar Id + /subscribe: + post: + description: subscribes a client + responses: + '201': + description: subscription successfully created + content: + application/json: + schema: {} + callbacks: + onData: + '{$request.query.callbackUrl}/data': + post: + requestBody: + description: subscription payload + content: + application/json: + schema: + type: object + properties: + userData: + type: string + parameters: + - name: baz_id + in: path + required: true + schema: + type: string + format: uuid + title: Baz Id + responses: + '202': + description: "OK" + diff --git a/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-3-1.yaml b/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-3-1.yaml index 10ba12c621..02f49f282b 100644 --- a/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-3-1.yaml +++ b/packages/apidom-ls/test/fixtures/validation/oas/parameter-defined-within-path-template-3-1.yaml @@ -2,11 +2,40 @@ openapi: 3.1.0 info: title: Foo version: 0.1.0 +components: + parameters: + test_id: + name: test_id + in: path + required: true + schema: + type: string + format: uuid + title: Test Id +webhooks: + newWebhook: + post: + requestBody: + description: new webook + content: + application/json: + schema: {} + parameters: + - name: hook_id + in: path + required: true + schema: + type: string + format: uuid + title: Hook Id + responses: + "200": + description: OK paths: /foo/{bar_id}: delete: - summary: Delete foo bar id - operationId: deleteFooBar + summary: Delete bar id + operationId: deleteBar responses: '200': description: Successful Response @@ -28,3 +57,36 @@ paths: type: string format: uuid title: Bar Id + /subscribe: + post: + description: subscribes a client + responses: + '201': + description: subscription successfully created + content: + application/json: + schema: {} + callbacks: + onData: + '{$request.query.callbackUrl}/data': + post: + requestBody: + description: subscription payload + content: + application/json: + schema: + type: object + properties: + userData: + type: string + parameters: + - name: baz_id + in: path + required: true + schema: + type: string + format: uuid + title: Baz Id + responses: + '202': + description: "OK" diff --git a/packages/apidom-ls/test/validate.ts b/packages/apidom-ls/test/validate.ts index 1926f37276..821fdb5b58 100644 --- a/packages/apidom-ls/test/validate.ts +++ b/packages/apidom-ls/test/validate.ts @@ -3580,7 +3580,7 @@ describe('apidom-ls-validate', function () { const result = await languageService.doValidation(doc, validationContext); const expected: Diagnostic[] = [ { - range: { start: { line: 16, character: 8 }, end: { line: 23, character: 23 } }, + range: { start: { line: 26, character: 8 }, end: { line: 33, character: 23 } }, message: 'parameter is not defined within path template', severity: 1, code: 3102000, @@ -3622,7 +3622,7 @@ describe('apidom-ls-validate', function () { const result = await languageService.doValidation(doc, validationContext); const expected: Diagnostic[] = [ { - range: { start: { line: 16, character: 8 }, end: { line: 22, character: 23 } }, + range: { start: { line: 26, character: 8 }, end: { line: 32, character: 23 } }, message: 'parameter is not defined within path template', severity: 1, code: 3102000, @@ -3664,7 +3664,7 @@ describe('apidom-ls-validate', function () { const result = await languageService.doValidation(doc, validationContext); const expected: Diagnostic[] = [ { - range: { start: { line: 16, character: 8 }, end: { line: 22, character: 23 } }, + range: { start: { line: 45, character: 8 }, end: { line: 51, character: 23 } }, message: 'parameter is not defined within path template', severity: 1, code: 3102000,