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
  • #1589
Closed
Open
Issue created Nov 30, 2018 by Administrator@rootContributor

[Elm] Missing import Json.Encode in Request.Default

Created by: Stealthmate

Description

When generating Request.Default, Json.Encode is not imported even though Encode.string and the like are used when building the request body.

openapi-generator version

3.3.4

OpenAPI declaration file content or url
{"swagger":"2.0","info":{"version":"","title":"Accountant API"},"host":"localhost:8080","paths":{"/me/foo":{"post":{"consumes":["application/json;charset=utf-8"],"produces":["application/json;charset=utf-8"],"parameters":[{"required":true,"schema":{"type":"string"},"in":"body","name":"body"}],"responses":{"400":{"description":"Invalid `body`"},"200":{"schema":{"type":"string"},"description":""}}}}}}
Command line used for generation

java -jar ./openapi-generator-cli.jar generate -i "http://localhost:8080/swagger.json" -l elm

Steps to reproduce

Just execute on the above file

Related issues/PRs
Suggest a fix/enhancement

It seems to me that there should be a check to see if we're dealing with a json primitive, in which case Json.Encode should be imported.

Assignee
Assign to
Time tracking