wolfadex / elm-open-api-cli

A CLI tool for generating Elm modules from Open API specs.
https://www.npmjs.com/package/elm-open-api
25 stars 6 forks source link

Support for lamdera/program-test #108

Closed miniBill closed 3 months ago

miniBill commented 3 months ago

I've rebased this PR upon #109 which should be easier to review and merge

miniBill commented 3 months ago

I've also fixed the URL generation, we now have:

<             String.replace
<                 "{runner_group_id}"
<                 (String.fromInt config.params.runner_group_id)
<                 (String.replace
<                     "{enterprise}"
<                     config.params.enterprise
<                     "https://api.github.com/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}"
<                 )
---
>             Url.Builder.crossOrigin
>                 "https://api.github.com"
>                 [ "enterprises"
>                 , config.params.enterprise
>                 , "actions"
>                 , "runner-groups"
>                 , String.fromInt config.params.runner_group_id
>                 ]
>                 []

Which I think is much better

miniBill commented 3 months ago

On the other hand we also have

<         { url = "https://api.github.com/app"
---
>         { url = Url.Builder.crossOrigin "https://api.github.com" [ "app" ] []

Which I think makes sense, but I want your opinion on which one you prefer @wolfadex

wolfadex commented 3 months ago

but I want your opinion on which one you prefer @wolfadex

Looks good to me. Feel free to merge when you want