-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TransformerError when generating Swagger #848
Comments
You're using some type(s) that is not supported in the JSON. If you see the detailed message, you can find out which type is occuring the error. Also, you can earily get the error mesage by using -----------------------------------------------------------
Nestia Swagger Generator
-----------------------------------------------------------
Analyzing reflections
- controllers: #2
- paths: #2
- routes: #2
Analyzing source codes
Generating Swagger Documents
..\..\..:BbsArticlesController.update:input - error TS(@nestia/sdk): invalid type detected.
- bigint type is not allowed.
TypeError: Invalid type detected
at D:\github\samchon\nestia\test\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_@[email protected]_reflect-met_4jhrkegpi6yclokwk3axwtrrcu\node_modules\@nestia\sdk\src\generates\SwaggerGenerator.ts:124:15
at Generator.next (<anonymous>)
at fulfilled (D:\github\samchon\nestia\test\node_modules\.pnpm\@[email protected]_@[email protected]_@[email protected]_@[email protected]_reflect-met_4jhrkegpi6yclokwk3axwtrrcu\node_modules\@nestia\sdk\lib\generates\SwaggerGenerator.js:5:58) |
Thanks a lot for your prompt reply, @samchon , but unfortunately I am not being shown any such helpful debug message. Could you please suggest any further possibilities of how I could fix this? Sharing the complete log here for reference:
|
You are using If possible, hope to be provided the reproducible repo for detailed debugging. |
Hi @samchon , you were indeed correct - the repo had some APIs which were directly responding using Fastify instead of using NestJS by returning the object. This is fixed and is working now. It took me a long time to find this out by trial and error, and I tried doing this by inserting logs in the Nestia / Typia code, but failed at getting any useful info. The error came out of Typia, but there was no source info there, and I couldn't find the right place to put in some debugging info in Nestia. If there is some way to inject some dog tags (debugging / source info) into this If you can give me any hints as to how to do this, happy to contribute and send a PR. |
Although my problem is solved, I am not closing the issue since it could still bother other users (even me myself) to easily locate the source of trouble. |
Bug Report
Firstly, really appreciate your hard work, @samchon ! Thanks for having this issue tracker so that we can request your support. Thanks again.
Summary
Write a short summary of the bug in here.
npx nestia swagger
should generate swagger filesTransformerError: invalid type on argument
I am trying to generate Swagger documentation using Nestia. I fixed every issue it was reporting, I am unfortunately not able to make sense of this error. If you could help me make sense of this error, I will be able to fix my code.
The reason I've reported this as a bug is this seems to be an exception not handled gracefully, maybe handling it and showing a friendly error would help users like me.
If I am missing something obvious, apologies in advance.
I get an error like:
Code occuring the bug
Versions:
The text was updated successfully, but these errors were encountered: