Closed nelsongomes closed 3 years ago
I applied the changes and released a new version 5.1.0. Thx for the fix.
Thank you
A sábado, 17/10/2020, 17:13, Sebastian Große notifications@github.com escreveu:
I applied the changes and released a new version 5.1.0. Thx for the fix.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Twipped/joi-to-swagger/issues/71#issuecomment-711037354, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAITSRD62BS4T3PW5KDCWQ3SLG7DHANCNFSM4SRYKOWQ .
@Mairu please copy this code, this is fix to allow to pass false boolean in defaultValue.
Code changes: const defaultValue = get(schema, '_flags.default'); if ((defaultValue || typeof defaultValue === 'boolean') && typeof defaultValue !== 'function') { swagger.default = defaultValue; }
test code: simpleTest( 'boolean', joi.boolean().default(false), { default: false, type: 'boolean', }, );
tried to open a PR, but was not possible.