This project was generated with Angular CLI version 10.0.6.
The v3.0.9 jar can be downloaded from here: swagger-codegen.
Update the swagger_definition config variable with swagger yaml file and swagger_codegen_jar config variable with swagger download jar from above step
In your terminal, run
NPM_CONFIG_SCRIPT_SHELL=bash npm run generate OR
npm run generate
OR Direct way:
java -jar <swagger-jar-location> generate -i <swagger-yaml-location> -l typescript-angular -o <location-to-generate-client>
Eg:
java -jar /tmp/swagger-codegen-cli-3.0.9.jar generate -i /tmp/pet-api.yaml -l typescript-angular -o src/app/client/
Run npm run proxy
for a dev server. Navigate to http://localhost:4200/
. The app will automatically reload if you change any of the source files.
Added service URL in proxy-config.json, this should avoid CORS issue
Follow my other repository to generate Java Spring Boot codegen using swagger