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