Closed warcayac closed 3 months ago
Workaround: Wrap it into optional and pass false as a second parameter
@david-plugge it doesn't work, isSuperuser is ignored and never is assigned the default value.
7d0e29b published on 1.0.23 including test case. Let me know if it works on your end.
it is working as expected, thanks.
Oh I think I'm relying on this bug for my app to work as intended. I'm not experienced with Typebox so when I saw that default
values would get translated to examples in Swagger, I started using them everywhere. But if they can actually permeate to the DB, I should go and update everything at once lol
What version of Elysia.JS is running?
1.0.22
What platform is your computer?
Linux 6.9.2-arch1-1 x86_64 unknown
What steps can reproduce the bug?
then try to send a POST request with this body:
{ "username": "admin", "password": "123456789", "email": "admin@chesu.org" }
What is the expected behavior?
body is accepted with default value applied to "isSuperuser" property
What do you see instead?
If I send this body: { "username": "admin", "password": "123456789", "email": "admin@chesu.org", "isSuperuser": false }
then it is accepted and processed.
Additional information
No response