Added basic openapi security scheme for the bearer auth header

ref #12
This commit is contained in:
Nicolai Ort 2020-12-05 17:47:32 +01:00
parent 7e4ce00c30
commit 5a4a6cdcef
1 changed files with 9 additions and 2 deletions

View File

@ -1,8 +1,8 @@
import { validationMetadatasToSchemas } from "class-validator-jsonschema";
import { Application } from "express";
import * as swaggerUiExpress from "swagger-ui-express";
import { getMetadataArgsStorage } from "routing-controllers";
import { routingControllersToSpec } from "routing-controllers-openapi";
import { validationMetadatasToSchemas } from "class-validator-jsonschema";
import * as swaggerUiExpress from "swagger-ui-express";
export default async (app: Application) => {
const storage = getMetadataArgsStorage();
@ -17,6 +17,13 @@ export default async (app: Application) => {
{
components: {
schemas,
"securitySchemes": {
"AuthToken": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "JWT"
}
}
},
info: {
description: "The the backend API for the LfK! runner system.",