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

Use a type variable instead of Never for APIs which can't error #131

Closed miniBill closed 1 month ago

miniBill commented 1 month ago

This PR also deletes the (redundant) alias declaration.

Alternatively, we could not delete it for better backwards compatibility.

miniBill commented 1 month ago

Example of the result:

diff --color -r generated-main/Trustmark/Api.elm generated-no-error/Trustmark/Api.elm
127c127
<         Result (OpenApi.Common.Error Trustmark.Types.DataAssessment_Error String) Trustmark.Types.AssessmentDtoAssessmentDtoMapperRetrofitAssessmentDtoResponse
---
>         Result (OpenApi.Common.Error e String) Trustmark.Types.AssessmentDtoAssessmentDtoMapperRetrofitAssessmentDtoResponse
wolfadex commented 1 month ago

I'm fine with a bit of backwards incompat since there's still a long ways to go before v1.0