Skip to content

Commit

Permalink
feat(apidom-ls): improve fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
kowalczyk-krzysztof committed Jan 4, 2024
1 parent 12223e3 commit 4d2dc74
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
6 changes: 3 additions & 3 deletions packages/apidom-ls/test/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4d2dc74

Please sign in to comment.