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

[elm] Add support for Elm 0.19 #937

Merged
merged 4 commits into from
Sep 4, 2018
Merged

Conversation

eriktim
Copy link
Contributor

@eriktim eriktim commented Aug 30, 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

Add support for Elm 0.19. An option elmVersion is added to set the desired Elm version (defaults to 0.19). @wing328 can you handle the CI stuff via #878? I already added the Elm 0.19 binary to Shippable.

After this PR gets merged I will work on some other open Elm issues.

@wing328
Copy link
Member

wing328 commented Sep 1, 2018

I've pushed a commit with minor enhancements and adding Elm 0.18, 0.19 to CI (travis, shippable)

Shippable (elm 0.19) reports the following errors:

Success! Compiled 1 module.
Compiling src/Request/Store.elm
-- NAMING ERROR ------------------------------------------ src/Request/Store.elm

I cannot find a `toString` variable:

61|     , url = basePath ++ "/store/order/" ++ toString orderId
                                               ^^^^^^^^
These names seem close though:

    List.any
    List.range
    asin
    ceiling

Hint: Read <https://elm-lang.org/0.19.0/imports> to see how `import`
declarations work in Elm.

[==================================================] - 1 / 1
                                                                     
Detected errors in 1 module.
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (bundle-test) on project ElmClientTests: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

@wing328
Copy link
Member

wing328 commented Sep 1, 2018

UPDATE: Travis (elm 0.18) reports the following errors:

Compiling src/Data/Order_.elm
Success! Compiled 2 modules.
Successfully generated /dev/null
Compiling src/Data/Pet.elm
-- TYPE MISMATCH ---------------------------------------------- src/Data/Pet.elm
The argument to function `list` is causing a mismatch.
61|                                                   Encode.list tagEncoder)
                                                                  ^^^^^^^^^^
Function `list` is expecting the argument to be:
    List ?
But it is:
    Tag -> ?
Hint: It looks like a function needs 1 more argument.
-- TYPE MISMATCH ---------------------------------------------- src/Data/Pet.elm
The 1st argument to function `list` is causing a mismatch.
60|                           Encode.list Encode.string) model.photoUrls 
                                          ^^^^^^^^^^^^^
Detected errors in 1 module.
Function `list` is expecting the 1st argument to be:
    List ?
But it is:
    String -> ?
Hint: It looks like a function needs 1 more argument.
-- TYPE MISMATCH ---------------------------------------------- src/Data/Pet.elm
Function `list` is expecting 1 argument, but was given 2.
60|                           Encode.list Encode.string) model.photoUrls 
                                                         ^^^^^^^^^^^^^^^
Maybe you forgot some parentheses? Or a comma?

@eriktim
Copy link
Contributor Author

eriktim commented Sep 1, 2018

Thanks @wing328! Will fix the errors.

@wing328
Copy link
Member

wing328 commented Sep 4, 2018

@trenneman all tests passed. Thanks for the enhancement!

@wing328 wing328 merged commit b24b6df into OpenAPITools:master Sep 4, 2018
@eriktim eriktim deleted the elm-0.19 branch September 4, 2018 06:25
@wing328
Copy link
Member

wing328 commented Sep 4, 2018

Upgrade Note

Elm version defaults 0.19. To use 0.18, please set elmVersion:

--additional-properties elmVersion=0.18

A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this pull request Feb 27, 2019
* [elm] Add support for Elm 0.19

* add elm 0.18 samples, update cli option

* fix elm 0.18 compile test

* [elm] 0.19 fixes & improvements
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

2 participants