fix(api): update bodyparser config to adonis 5

This commit is contained in:
Valentin Kaelin 2021-05-22 18:23:38 +02:00
parent 8b9c210ea6
commit e6cd4d340b

View file

@ -53,6 +53,19 @@ const bodyParserConfig: BodyParserConfig = {
encoding: 'utf-8',
limit: '1mb',
queryString: {},
/*
|--------------------------------------------------------------------------
| Convert empty strings to null
|--------------------------------------------------------------------------
|
| Convert empty form fields to null. HTML forms results in field string
| value when the field is left blank. This option normalizes all the blank
| field values to "null"
|
*/
convertEmptyStringsToNull: true,
types: ['application/x-www-form-urlencoded'],
},
@ -143,6 +156,18 @@ const bodyParserConfig: BodyParserConfig = {
*/
encoding: 'utf-8',
/*
|--------------------------------------------------------------------------
| Convert empty strings to null
|--------------------------------------------------------------------------
|
| Convert empty form fields to null. HTML forms results in field string
| value when the field is left blank. This option normalizes all the blank
| field values to "null"
|
*/
convertEmptyStringsToNull: true,
/*
|--------------------------------------------------------------------------
| Max Fields