Closed maximebroubrou closed 1 month ago
Hello there maximebroubrou π
Thank you for opening your very first issue in this project.
We will try to get back to you as soon as we can.π
Related to https://github.com/lukeautry/tsoa/issues/1515?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days
Description:
After updating TSOA from version 6.0.0 to 6.2.0, we encountered a validation error when attempting to PATCH properties that were previously defined using TypeScript utility types (e.g., Partial, Pick) and are explicitly allowed to be null (defined as number | null). We resolved this issue by changing the type definitions to explicitly define each property without embedded utility types, but it raises concerns about TSOA's handling of such TypeScript constructs in the latest version.
To Reproduce:
Steps to reproduce the behavior:
Original type definition using embedded utility types:
Set up
anEntity
with the columns:Set up a body update type:
Set up a TSOA route to update this entity, using a PATCH method:
Launch a server API and: Attempt to PATCH the
aProperty1
property with a value of null : it works Attempt to PATCH theaProperty3
property with a value of null :Validation Failed
with the following error:Changing the type definitions to explicitly define each field, as shown below, resolves the issue:
Additional Context:
This issue is particularly concerning because it affects our ability to use TypeScript utility types effectively with TSOA, limiting our approach to defining flexible and maintainable APIs. It also suggests a potential regression or change in how TSOA handles TypeScript type resolution in its latest version? π€