Archived
2

api definition created

This commit is contained in:
VLE2FE 2020-04-20 16:13:49 +02:00
parent 8841abc373
commit 5a01bf013a
4 changed files with 1107 additions and 55 deletions

1105
oas.yaml Normal file

File diff suppressed because it is too large Load Diff

53
oas.yml
View File

@ -1,53 +0,0 @@
openapi: 3.0.2
info:
title: Digital fingerprint of plastics - API
version: 1.0.0
description: Gives access to the project database
servers:
- url: http://localhost:3000
description: local server
- url: https://digital-fingerprint-of-plastics-api.apps.de1.bosch-iot-cloud.com/
description: server on the BIC
tags:
- name: /
paths:
/:
get:
summary: Root method
tags:
- /
responses:
200:
description: Server is working
content:
application/json:
schema:
properties:
message:
type: string
example: 'API server up and running!'
500:
$ref: '#/components/responses/500'
components:
responses:
500:
description: Internal server error
content:
application/json:
schema:
properties:
message:
type: string
example: 'Internal server error'
error:
type: boolean
example: true

View File

@ -6,7 +6,7 @@
"scripts": { "scripts": {
"test": "mocha dist/**/**.spec.js", "test": "mocha dist/**/**.spec.js",
"start": "tsc && node dist/index.js", "start": "tsc && node dist/index.js",
"dev": "nodemon -e ts --exec \"npm run start\"" "dev": "nodemon -e ts,yaml --exec \"npm run start\""
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",

View File

@ -44,7 +44,7 @@ app.use('/', require('./routes/root'));
// Swagger UI // Swagger UI
app.use('/api', swagger.serve, swagger.setup( app.use('/api', swagger.serve, swagger.setup(
yaml.load('./oas.yml'), yaml.load('./oas.yaml'),
{ {
defaultModelsExpandDepth: -1, defaultModelsExpandDepth: -1,
customCss: '.swagger-ui .topbar { display: none }' customCss: '.swagger-ui .topbar { display: none }'