@athenna/http 5.49.0 → 5.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenna/http",
3
- "version": "5.49.0",
3
+ "version": "5.50.0",
4
4
  "description": "The Athenna Http server. Built on top of fastify.",
5
5
  "license": "MIT",
6
6
  "author": "João Lenon <lenon@athenna.io>",
@@ -13,7 +13,7 @@ import { Log } from '@athenna/logger';
13
13
  import { Config } from '@athenna/config';
14
14
  import { sep, isAbsolute, resolve } from 'node:path';
15
15
  import { Annotation } from '@athenna/ioc';
16
- import { File, Path, Module, String } from '@athenna/common';
16
+ import { File, Path, Module, String, Json } from '@athenna/common';
17
17
  import { HttpExceptionHandler } from '#src/handlers/HttpExceptionHandler';
18
18
  export class HttpKernel {
19
19
  /**
@@ -57,7 +57,14 @@ export class HttpKernel {
57
57
  return;
58
58
  }
59
59
  if (swaggerPlugin) {
60
- await Server.plugin(swaggerPlugin, Config.get('http.swagger.configurations'));
60
+ const openapiConfig = Json.omit(Config.get('openapi', {}), ['paths']);
61
+ const pluginConfig = Json.omit(Config.get('http.swagger.configurations', {}), ['swagger']);
62
+ const swaggerConfig = Config.get('http.swagger.configurations.swagger', {});
63
+ await Server.plugin(swaggerPlugin, {
64
+ ...pluginConfig,
65
+ ...openapiConfig,
66
+ ...swaggerConfig
67
+ });
61
68
  }
62
69
  else {
63
70
  debug('Not able to register swagger plugin. Install @fastify/swagger package.');