Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #1503
Closed
Open
Issue created Nov 20, 2018 by Administrator@rootContributor

[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?

Assignee
Assign to
Time tracking