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] QueryParameter with a Default Value/single value enum is not handled in the generated Typescript method #8339

Closed
kunal-pmj opened this issue Jun 20, 2018 · 4 comments

Comments

@kunal-pmj
Copy link
Contributor

Description

Constant Values for the QueryParameter are not taken into account while generating the TypeScript Code

Swagger-codegen version

Swagger Code Gen Cli 2.3.1

Swagger declaration file content or url

https://gist.github.com/kunal-pmj/2ac190b160382093893c036dfc313c30

Command line used for generation

java -jar swagger-codegen-cli.jar generate -i test.json -l typescript-angular -o test-api

Steps to reproduce

Pretty Strainght Forward
Use the Swagger JSON file to generate typescript-angular SDK. The productdetails.service.ts
file does not handle the Query parameters's Constant Value

Related issues/PRs
Suggest a fix/enhancement

Handle the Constant QueryParameter Value in the generate ts library. The only value that can be set to this parameter is the one defined in the enum

@kunal-pmj
Copy link
Contributor Author

Since, there are no updates on this Issue.
I have made a fix by modifying

  1. CodegenParameter.java and
  2. api.service.mustache

Thanks

@HugoMario
Copy link
Contributor

HugoMario commented Jul 26, 2018

Hey again @kunal-pmj, this LGTM, i would just recommend to edit the petstore sample adding this case, only if it's not present. and based on this, update the typescript-angular samples. wdyt?

i could give you a hand if you need help.

@kunal-pmj
Copy link
Contributor Author

Let me add the tests. I will contact you if I need any help.

thanks
Kunal

@kunal-pmj
Copy link
Contributor Author

Closing the Issue

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

2 participants