Closed 8471919 closed 6 months ago
@samchon This error occurs during the "DO ASSIGN" process in the ExceptionAnalyzer module. The exception cases are as follows:
When the exception schema is a union type, and each sub-type is an object type using hierarchical type names, differences in type name representation can occur, causing mismatches. For example, if the type name is ErrorCode.NotFound
, in a tuple it will be fully represented while in func.exceptions only NotFound
might be indicated.
When the exception schema is in generic form, the type names are not appropriately split. Currently, a simple split and sort operation is performed based on the " | " delimiter in the entire string. In this process, if there's a type like Gen<101 | 202>, it might be split into "Gen<101" and "202>", causing issues with proper type name comparison.
Moreover, when the exception schema is generic, it's necessary to ensure that the imports of the types injected as generics are done correctly. For example, if there's a type name like Exception<NotFound | Unauthorize>, the Exception type, NotFound type, and Unauthorized type should each be imported correctly.
If namespaced type being utilized, such bug be occured.
I'll fix this problem ASAP. Thanks for reporting.
Summary
Write a short summary of the bug in here.
In
npx nestia swagger
. when I use union type of object type,@TypedExeption
doesn't make swagger document.Exception is not displayed on the swagger document.
Code occuring the bug
Exactly I want to use
@TypedException
this way,but, Union type doesn't work about object union type.
this is the result of above code. Here is no exception description.
and this not work too.
and I want for you to make this using "oneOf" of swagger.