@egodigital/express-controllers
Advanced tools
Comparing version
# Change Log (@egodigital/express-controllers) | ||
## 4.5.0 | ||
## 4.5.1 | ||
@@ -5,0 +5,0 @@ * can define optional `__updateSwaggerPath` method in [controller](https://egodigital.github.io/express-controllers/interfaces/_index_.controller.html) now |
{ | ||
"name": "@egodigital/express-controllers", | ||
"version": "4.5.0", | ||
"version": "4.5.1", | ||
"description": "Sets up controllers for Express framework.", | ||
@@ -5,0 +5,0 @@ "author": "e.GO Digital GmbH, Aachen, Germany", |
@@ -372,2 +372,3 @@ [](https://www.npmjs.com/package/@egodigital/express-controllers) | ||
swagger: { | ||
// s. https://swagger.io/docs/specification/2-0/describing-responses/ | ||
definitions: { | ||
@@ -419,2 +420,17 @@ 'SuccessResponse': { | ||
// update each path definition with default values (s. below) | ||
function pathDefinitionUpdater(ctx: SwaggerPathDefinitionUpdaterContext) { | ||
// Bad Request | ||
ctx.definition['responses']['400'] = { | ||
"description": "Bad request!" | ||
}; | ||
// Internal Server Error | ||
ctx.definition['responses']['500'] = { | ||
"description": "Operation has failed!" | ||
}; | ||
} | ||
/** | ||
@@ -463,16 +479,2 @@ * /controllers/api/index.ts | ||
} | ||
// update each path definition with default values | ||
function pathDefinitionUpdater(ctx: SwaggerPathDefinitionUpdaterContext) { | ||
// Bad Request | ||
ctx.definition['responses']['400'] = { | ||
"description": "Bad request!" | ||
}; | ||
// Internal Server Error | ||
ctx.definition['responses']['500'] = { | ||
"description": "Operation has failed!" | ||
}; | ||
} | ||
``` | ||
@@ -479,0 +481,0 @@ |
117731
0.08%482
0.42%