parent
796b8942d8
commit
51ff9defc5
|
@ -2,23 +2,27 @@ 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 { validationMetadatasToSchemas } from "class-validator-jsonschema";
|
||||
|
||||
export default async (app: Application) => {
|
||||
const storage = getMetadataArgsStorage();
|
||||
const schemas = validationMetadatasToSchemas({
|
||||
refPointerPrefix: '#/components/schemas/',
|
||||
});
|
||||
const spec = routingControllersToSpec(storage, {}, {
|
||||
components: {
|
||||
schemas,
|
||||
info: {
|
||||
description: 'LfK! Backend API`',
|
||||
title: 'LfK! Backend API',
|
||||
version: '1.0.0'
|
||||
}
|
||||
});
|
||||
app.use("/docs", swaggerUiExpress.serve, swaggerUiExpress.setup(spec));
|
||||
return app;
|
||||
const storage = getMetadataArgsStorage();
|
||||
const schemas = validationMetadatasToSchemas({
|
||||
refPointerPrefix: "#/components/schemas/",
|
||||
});
|
||||
const spec = routingControllersToSpec(
|
||||
storage,
|
||||
{},
|
||||
{
|
||||
components: {
|
||||
schemas,
|
||||
},
|
||||
info: {
|
||||
description: "LfK! Backend API`",
|
||||
title: "LfK! Backend API",
|
||||
version: "1.0.0",
|
||||
},
|
||||
}
|
||||
);
|
||||
app.use("/docs", swaggerUiExpress.serve, swaggerUiExpress.setup(spec));
|
||||
return app;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue