Skip to content

Commit

Permalink
feat(apidom-ls): add reference test case
Browse files Browse the repository at this point in the history
  • Loading branch information
kowalczyk-krzysztof committed Dec 15, 2023
1 parent 171fe97 commit 7b88bdd
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +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: Foo Id
paths:
/foo/bar/{baz}/test/{foo_id}/baz/{bar_id}:
delete:
summary: Delete foo bar baz
operationId: >-
deleteFooBarBaz
operationId: deleteFooBarBaz
parameters:
- name: foo_id
in: path
Expand All @@ -32,8 +41,7 @@ paths:
/test/{foo_id}/{bar_id}:
get:
summary: Get test foo bar
operationId: >-
getTestFooBar
operationId: getTestFooBar
parameters:
- name: foo_id
in: path
Expand All @@ -48,3 +56,15 @@ paths:
content:
application/json:
schema: {}
/reference/{test_id}/{bar_id}:
get:
summary: Get test bar
operationId: getReferenceFooBar
parameters:
- $ref: '#/components/parameters/test_id'
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
11 changes: 9 additions & 2 deletions packages/apidom-ls/test/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3403,14 +3403,21 @@ describe('apidom-ls-validate', function () {
const result = await languageService.doValidation(doc, validationContext);
const expected: Diagnostic[] = [
{
range: { start: { line: 5, character: 2 }, end: { line: 5, character: 43 } },
range: { start: { line: 15, character: 2 }, end: { line: 15, character: 43 } },
message: 'path template expressions is not matched with Parameter Object(s)',
severity: 1,
code: 3040101,
source: 'apilint',
},
{
range: { start: { line: 31, character: 2 }, end: { line: 31, character: 25 } },
range: { start: { line: 40, character: 2 }, end: { line: 40, character: 25 } },
message: 'path template expressions is not matched with Parameter Object(s)',
severity: 1,
code: 3040101,
source: 'apilint',
},
{
range: { start: { line: 58, character: 2 }, end: { line: 58, character: 31 } },
message: 'path template expressions is not matched with Parameter Object(s)',
severity: 1,
code: 3040101,
Expand Down

0 comments on commit 7b88bdd

Please sign in to comment.