File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 11import type { BaseConfitSchema } from '@sesamecare-oss/confit' ;
22import type { middleware } from 'express-openapi-validator' ;
33import type { Level } from 'pino' ;
4+ import bodyParser from 'body-parser' ;
45
56export interface ConfigurationItemEnabled {
67 enabled ?: boolean ;
@@ -28,8 +29,8 @@ export interface ConfigurationSchema extends BaseConfitSchema {
2829 etag ?: boolean ;
2930 cookieParser ?: boolean ;
3031 bodyParsers ?: {
31- json ?: boolean ;
32- form ?: boolean ;
32+ json ?: boolean | Parameters < typeof bodyParser . json > [ 0 ] ;
33+ form ?: boolean | Parameters < typeof bodyParser . urlencoded > [ 0 ] ;
3334 } ;
3435 // Set static.enabled to true to enable static assets to be served
3536 static ?: ConfigurationItemEnabled & {
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ export async function startApp<
174174 }
175175
176176 if ( routing ?. bodyParsers ?. json ) {
177+ const jsonArgs = typeof routing . bodyParsers . json === 'object' ? routing . bodyParsers . json : { } ;
177178 app . use (
178179 express . json ( {
179180 verify ( req , res , buf ) {
@@ -182,6 +183,7 @@ export async function startApp<
182183 locals . rawBody = buf ;
183184 }
184185 } ,
186+ ...jsonArgs ,
185187 } ) ,
186188 ) ;
187189 }
You can’t perform that action at this time.
0 commit comments