-
-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds tests for components.parameters
- Loading branch information
Showing
2 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import * as path from 'path'; | ||
import * as express from 'express'; | ||
import { expect } from 'chai'; | ||
import * as request from 'supertest'; | ||
import { createApp } from './common/app'; | ||
import * as packageJson from '../package.json'; | ||
|
||
describe(packageJson.name, () => { | ||
let app = null; | ||
|
||
before(async () => { | ||
// Set up the express app | ||
const apiSpec = path.join('test', 'resources', 'component.params.yaml'); | ||
app = await createApp({ apiSpec }, 3005, app => | ||
app.use( | ||
`/`, | ||
express | ||
.Router() | ||
.get(`/api/v1/meeting/:id`, (req, res) => res.json(req.params)), | ||
), | ||
); | ||
}); | ||
|
||
after(() => { | ||
app.server.close(); | ||
}); | ||
|
||
it('should handle components.parameter $refs', async () => { | ||
const id = `01701deb-34cb-46c2-972d-6eeea3850342`; | ||
request(app) | ||
.get(`/api/v1/meeting/${id}`) | ||
.expect(200) | ||
.then(r => { | ||
expect(r.body.id).to.equal(id); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: Manual Handling | ||
description: API documentation for manual handling. | ||
version: 0.1.9 | ||
servers: | ||
- url: / | ||
description: Self | ||
- url: http://localhost:3010 | ||
description: local | ||
- url: https://mhcore.quinoid.in | ||
description: Development server | ||
paths: | ||
/api/v1/meeting/{meetingId}: | ||
get: | ||
description: Get meeting details by meeting id | ||
summary: Get meeting details by meeting id | ||
tags: | ||
- Meeting | ||
parameters: | ||
- $ref: '#/components/parameters/MeetingId' | ||
# - name: meetingId | ||
# in: path | ||
# required: true | ||
# description: Meeting id | ||
# schema: | ||
# $ref: '#/components/parameters/MeetingId' | ||
responses: | ||
'200': | ||
description: Meeting token obtained successfully | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/parameters/MeetingId' | ||
components: | ||
securitySchemes: | ||
bearerAuth: | ||
type: http | ||
scheme: bearer | ||
bearerFormat: JWT | ||
parameters: | ||
MeetingId: | ||
name: meetingId | ||
description: Meeting id of the session | ||
required: true | ||
in: path | ||
example: 01701deb-34cb-46c2-972d-6eeea3850342 | ||
schema: | ||
type: string |