[elm] Question is UUID referenced but not generated?
Created by: andys8
I'm not sure about this issue, so I'll raise it in form of a question.
The elm client generation creates data types like this (shortened).
module Data.Label exposing (Label, Type(..), decoder, encoder)
import Data.UUID as UUID exposing (UUID)
import Dict exposing (Dict)
import Json.Decode as Decode exposing (Decoder)
import Json.Decode.Pipeline exposing (optional, required)
import Json.Encode as Encode
type alias Label =
{ id : Maybe UUID
, type_ : Type
, text : String
}
but there is no Data.UUID
file.
There is also no dependency in the elm.json
template:
https://github.com/OpenAPITools/openapi-generator/blob/b24b6df448878cd8eccae234644e5123785295b5/modules/openapi-generator/src/main/resources/elm/elm.mustache
Fix
Added the dependency "danyx23/elm-uuid": "2.1.2"
and a Data/UUID.elm
file.
module Data.UUID exposing (UUID, decoder, encoder)
import Json.Decode as Decode exposing (Decoder)
import Json.Encode as Encode
import Uuid
type alias UUID =
Uuid.Uuid
decoder : Decoder UUID
decoder =
Uuid.decoder
encoder : UUID -> Encode.Value
encoder =
Uuid.encode
Am I missing something or is the client generation missing something?