-
Notifications
You must be signed in to change notification settings - Fork 3
Generated code does not seem to compile #6
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
Comments
I've got the same issue here: in each api file I can't get over these errors (all seems to be related to instanceof left-hand side being "string" instead of "any" and the next few lines with the .d . All seems to be related with Date checks anyway). Not sure whether it's related to the typescript version itself (using ~2.1.5 here) or if it's a bug. Also, there is another compile issue with the Filter parameter, passed as: |
I was using ~2.0.0 which actually equates to 2.0.10. I just tried with the latest 2.2.2 and no change, so this seems to be a bug not a version issue. |
@briosheje Looks like this is fixed in master and if you do a build of 2.2.3-SNAPSHOT, you get completely different api code. Not ideal, but a better work around. |
@briosheje Yeah confirmed, it's fixed in Master. |
Errors everywhere. Beware. Time sink. This plugin is completely broken and does not work at all. |
This is now fixed as 2.2.3 of the swagger plugin is released. If you have this issue, move to 2.2.3. |
In the generated file DefaultAPI.ts I am getting quite a few errors regarding the instance of check. For instance:
Is generated for my yaml file and yet when an attempt to compile this I get:
[INFO] ERROR in src/app/api/DefaultApi.ts (353,16): The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter.
[INFO] src/app/api/DefaultApi.ts (354,79): Property 'd' does not exist on type 'string & Date'.
There are several of these in the file generally regarding a passed in parameter and a check around that parameter to see if it is of type 'Date'.
I have seen the following issue reported here, but that seems very out of date and resolved a long time ago:
microsoft/TypeScript#2775
As this is generated code, how can I effect the operation and get the code to compile successfully?
I'm using swagger-codegen 2.2.2 maven plugin, with setting:
typescript-angular2
The text was updated successfully, but these errors were encountered: