Skip to content
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

[TypeScript-Angular] Override keyword needed in encoder.ts file #11852

Closed
thisisthemurph opened this issue Aug 11, 2022 · 7 comments
Closed

[TypeScript-Angular] Override keyword needed in encoder.ts file #11852

thisisthemurph opened this issue Aug 11, 2022 · 7 comments

Comments

@thisisthemurph
Copy link

Description

When generating the Angular TypeScript api from my swagger.yaml file I have to manually fix the below error, which is presented when running ng serve to serve the application.

error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'HttpUrlEncodingCodec'.

This fix is to navigate to the generated encoder.ts file and manually prepend the two methods with the override keyword.

Swagger-codegen version

2.4.27 (current stable)

Command line used for generation
java -jar ../swagger-codegen-cli.jar generate -i ./swagger.yaml -l typescript-angular -o ../web-ui/src/app/shared/data-access/api-client -c ./swagger-config.json
Steps to reproduce
  1. Generate typescript-angular api from swagger file
  2. Serve the Angular application
  3. Review error
@thisisthemurph thisisthemurph changed the title [TypeScript-Angular] Override keyword needed in [TypeScript-Angular] Override keyword needed in encoder.ts file Aug 11, 2022
@NanezX
Copy link

NanezX commented Aug 20, 2022

Same issue here. Our project use it and we have to add the override keyword everytime we generate the files.

We are using Swagger-codegen version 3.0.31, but also using the 3.0.35 have this error.

This is how we called it:

java -jar ./openapi-generator/swagger-codegen-cli-3.0.35.jar generate -l typescript-angular -i ./apps/api/openapi/openapi.json -o ./libs/dashboard-sdk -c ./apps/api/openapi/config.json

@Traivok
Copy link

Traivok commented Sep 22, 2022

Same issue here. I'm using swagger-codegen version 3.0.35.

@thekhegay
Copy link

Same issue.

@HugoMario

@viktorsml
Copy link
Contributor

Same issue here. Just fixed and created a PR.

viktorsml added a commit to viktorsml/swagger-codegen that referenced this issue Dec 4, 2022
viktorsml added a commit to viktorsml/swagger-codegen that referenced this issue Jan 26, 2023
viktorsml added a commit to viktorsml/swagger-codegen that referenced this issue Feb 14, 2023
@paibrahim
Copy link

If you do not explicitly need to have the override keyword then set the compilerOptions.noImplicitOverride to false in the tsconfig.json file.

viktorsml added a commit to viktorsml/swagger-codegen that referenced this issue May 11, 2023
viktorsml added a commit to viktorsml/swagger-codegen that referenced this issue May 27, 2023
@mohansvrm
Copy link

mohansvrm commented Jun 5, 2023

What is the resolution for this? I am facing the same issue..

@HugoMario
Copy link
Contributor

the override keyword can be set using:

--additional-properties useOverride=true

This will be available for next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants