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

Add logic to handle uuid in Elm generator (0.19) #1075

Merged
merged 1 commit into from
Sep 21, 2018
Merged

Conversation

wing328
Copy link
Member

@wing328 wing328 commented Sep 21, 2018

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master, 3.3.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

To fix the following issue reported in the chat room by @mxinden

Exception in thread "main" java.lang.RuntimeException: Could not generate api file for 'Silence'
        at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:596)
        at org.openapitools.codegen.DefaultGenerator.generate(DefaultGenerator.java:828)
        at org.openapitools.codegen.cmd.Generate.run(Generate.java:342)
        at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:62)
Caused by: java.lang.RuntimeException: Parameter 'silenceID' cannot be converted to a string
        at org.openapitools.codegen.languages.ElmClientCodegen.paramToString(ElmClientCodegen.java:542)
        at org.openapitools.codegen.languages.ElmClientCodegen.postProcessOperationsWithModels(ElmClientCodegen.java:446)
        at org.openapitools.codegen.DefaultGenerator.processOperations(DefaultGenerator.java:1037)
        at org.openapitools.codegen.DefaultGenerator.generateApis(DefaultGenerator.java:507)
        ... 3 more

Spec: https://github.com/prometheus/alertmanager/blob/master/api/v2/openapi.yaml

cc @trenneman

@wing328 wing328 added this to the 3.3.0 milestone Sep 21, 2018
@wing328 wing328 changed the title Add logic to handle uuid in elm generator Add logic to handle uuid in Elm generator (0.19) Sep 21, 2018
@eriktim
Copy link
Contributor

eriktim commented Sep 21, 2018

Edit: are you sure this won't fail on other parts as well? Can check later.

@wing328
Copy link
Member Author

wing328 commented Sep 21, 2018

@trenneman yes, we need another PR to handle other types as well, e.g. boolean using isBoolean. I'll create an issue for tracking and we'll work on that.

@eriktim
Copy link
Contributor

eriktim commented Sep 21, 2018

Yes that as well, thanks. But I mean if a UUID is not processed as a string it might fail in other parts of the generated Elm code as well. I am not sure.

@wing328
Copy link
Member Author

wing328 commented Sep 21, 2018

I've filed #1079 for tracking.

@mxinden
Copy link
Contributor

mxinden commented Sep 24, 2018

@wing328 thanks a lot for the quick fix!

@wing328
Copy link
Member Author

wing328 commented Sep 25, 2018

No problem. We'll include the fix and other enhancements in the 3.3.0 release scheduled next week.

A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants