You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There was a problem resolving type of 'TestResponse'.
GenerateMetadataError: Couldn't resolve literal node: -1
at TypeResolver.getLiteralValue (/<workspace>/node_modules/@tsoa/cli/src/metadataGeneration/typeResolver.ts:514:85)
Without the -1 in the type literal the build succeeds.
Sorting
I'm submitting a ...
I confirm that I
Expected Behavior
Type literals in an interface used as response should be able to include negative numbers.
Simple example controller:
Current Behavior
The above example fails to build with
Without the
-1
in the type literal the build succeeds.Possible Solution
The Problem is in the
getLiteralValue
method:tsoa/packages/cli/src/metadataGeneration/typeResolver.ts
Lines 501 to 517 in 95021e8
For the literal
-1
thetypeNode.literal.kind
ists.SyntaxKind.PrefixUnaryExpression
.Adding the following code to the
switch
will fix the issue:Steps to Reproduce
See example above.
Context (Environment)
Version of the library: 6.6.0
Version of NodeJS: 20.16.0
Detailed Description
Breaking change?
I don't think so.
The text was updated successfully, but these errors were encountered: