-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathswagger.js
More file actions
41 lines (38 loc) · 896 Bytes
/
swagger.js
File metadata and controls
41 lines (38 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// swagger.js
const swaggerJsDoc = require('swagger-jsdoc')
// Import all schemas
const schemas = require('./src/schemas')
const swaggerOptions = {
swaggerDefinition: {
openapi: '3.0.0',
info: {
title: 'Eclipse ioFog Controller REST API Documentation',
version: '3.7.0',
description: 'Eclipse ioFog Controller REST API Documentation'
},
servers: [
{
url: 'http://localhost:51121/api/v3'
}
],
components: {
securitySchemes: {
authToken: {
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT',
description: 'JWT token for authentication (user or agent)'
}
},
schemas: schemas
},
security: [
{
authToken: []
}
]
},
apis: ['./src/routes/*.js']
}
const swaggerDocs = swaggerJsDoc(swaggerOptions)
module.exports = swaggerDocs