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
Upon generating the code for my angular project, I copied it into my app directory. Immediately, the compiler starts spitting out errors about being unable to find variables. This is an example of the exact error (there are a lot of them):
ERROR in /home/def_monk/code/eve-calendar/src/app/esi/api/wars.service.ts (163,92): Cannot find name 'war_id'.
It's pretty easy to identify what it's talking about, since the uses of snakecase are very rare in the files. There is a mismatch in the parameter name and what is used in the return statement. The function in which that particular error occurs is here:
/** * List kills for a war * Return a list of kills related to a war --- Alternate route: `/v1/wars/{war_id}/killmails/` Alternate route: `/legacy/wars/{war_id}/killmails/` Alternate route: `/dev/wars/{war_id}/killmails/` --- This route is cached for up to 3600 seconds * @param warId A valid war ID * @param datasource The server name you would like data from * @param page Which page of results to return * @param userAgent Client identifier, takes precedence over headers * @param xUserAgent Client identifier, takes precedence over User-Agent */publicgetWarsWarIdKillmails(warId: number,datasource?: string,page?: number,userAgent?: string,xUserAgent?: string): Observable<Array<GetWarsWarIdKillmails200Ok>>{if(warId===null||warId===undefined){thrownewError('Required parameter warId was null or undefined when calling getWarsWarIdKillmails.');}let queryParameters =newHttpParams({encoder: newCustomHttpUrlEncodingCodec()});if(datasource!==undefined){
queryParameters =queryParameters.set('datasource',<any>datasource);}if(page!==undefined){
queryParameters =queryParameters.set('page',<any>page);}if(userAgent!==undefined){
queryParameters =queryParameters.set('user_agent',<any>userAgent);}letheaders=this.defaultHeaders;if(xUserAgent!==undefined&&xUserAgent!==null){
headers =headers.set('X-User-Agent',String(xUserAgent));}returnthis.httpClient.get<any>(`${this.basePath}/wars/${encodeURIComponent(String(war_id))}/killmails/`,{params: queryParameters,headers: headers,withCredentials: this.configuration.withCredentials,});}
Swagger-codegen version
Master at time of pull: f0b7dae (which would mean actual version is 2.3.0, if I understand correctly).
Generate code, and try to move it into the angular application. The typescript will not be able to compile. I'm used Angular CLI to do the project generation and the compile/serve.
Related issues/PRs
#4264 seems related, since it looks to be when the change to camelcase was made to match the style guide.
Suggest a fix/enhancement
Looking around to try and figure out what the problem was, I eventually made my way to this line of mustache template for the services. That said, this is my first time using both codegen and angular2+, and I know nothing about using mustache templates, so I have no idea if I'm actually correct in guessing it has something to do with that line of code. Lol. But simply using the camelcase version of the parameter, instead of snakecase, seems like it would fix the error.
The text was updated successfully, but these errors were encountered:
Yea. I was looking and just realized that the line I was pointing to was using path instead of paramName like the function parameters were. I was trying to find where path was defined just now, so that's good. Lol. I'll look into it, see if I can figure out an easy fix.
Description
Upon generating the code for my angular project, I copied it into my app directory. Immediately, the compiler starts spitting out errors about being unable to find variables. This is an example of the exact error (there are a lot of them):
ERROR in /home/def_monk/code/eve-calendar/src/app/esi/api/wars.service.ts (163,92): Cannot find name 'war_id'.
It's pretty easy to identify what it's talking about, since the uses of snakecase are very rare in the files. There is a mismatch in the parameter name and what is used in the return statement. The function in which that particular error occurs is here:
Swagger-codegen version
Master at time of pull: f0b7dae (which would mean actual version is 2.3.0, if I understand correctly).
Swagger declaration file content or url
https://esi.tech.ccp.is/latest/swagger.json?datasource=tranquility
Command line used for generation
Steps to reproduce
Generate code, and try to move it into the angular application. The typescript will not be able to compile. I'm used Angular CLI to do the project generation and the compile/serve.
Related issues/PRs
#4264 seems related, since it looks to be when the change to camelcase was made to match the style guide.
Suggest a fix/enhancement
Looking around to try and figure out what the problem was, I eventually made my way to this line of mustache template for the services. That said, this is my first time using both codegen and angular2+, and I know nothing about using mustache templates, so I have no idea if I'm actually correct in guessing it has something to do with that line of code. Lol. But simply using the camelcase version of the parameter, instead of snakecase, seems like it would fix the error.
The text was updated successfully, but these errors were encountered: