Skip to content

Commit f491f89

Browse files
committed
fix: disable ajv coerce types by default
1 parent 4174fe3 commit f491f89

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@athenna/http",
3-
"version": "5.52.0",
3+
"version": "5.53.0",
44
"description": "The Athenna Http server. Built on top of fastify.",
55
"license": "MIT",
66
"author": "João Lenon <lenon@athenna.io>",

src/providers/HttpServerProvider.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,22 @@
77
* file that was distributed with this source code.
88
*/
99

10+
import { Options } from '@athenna/common'
1011
import { ServiceProvider } from '@athenna/ioc'
1112
import { ServerImpl } from '#src/server/ServerImpl'
13+
import type { FastifyServerOptions } from 'fastify'
1214

1315
export class HttpServerProvider extends ServiceProvider {
1416
public register() {
15-
this.container.instance(
16-
'Athenna/Core/HttpServer',
17-
new ServerImpl(Config.get('http.fastify'))
18-
)
17+
const fastifyOptions = Options.create(Config.get<FastifyServerOptions>('http.fastify'), {
18+
ajv: {
19+
customOptions: {
20+
coerceTypes: false
21+
}
22+
}
23+
})
24+
25+
this.container.instance('Athenna/Core/HttpServer', new ServerImpl(fastifyOptions))
1926
}
2027

2128
public async shutdown() {

0 commit comments

Comments
 (0)