OpenAPITools / OpenAPITools/openapi-generator

[BUG] [haskell-http-client]: Cannot create HTTP client for Docker

Open
#2,527 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Haskell Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

openapi-generator successfully generates HTTP client for Docker, but I can't compile it using stack haddock. It ends with this error:

[ 6 of 26] Compiling DockerEngine.Model ( lib/DockerEngine/Model.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/DockerEngine/Model.o )

/home/egorcod/Документы/openapi-docker/lib/DockerEngine/Model.hs:6391:51: error:
    Not in scope: type constructor or class ‘Array’
    Perhaps you meant ‘A.Array’ (imported from Data.Aeson)
    Perhaps you want to add ‘Array’ to the import list in the import of
    ‘Data.Aeson’ (lib/DockerEngine/Model.hs:34:1-41).
     |
6391 |   , systemDataUsageResponseContainers :: !(Maybe [Array]) -- ^ "Containers"
     |
openapi-generator version
> docker run --rm openapitools/openapi-generator-cli version
4.0.0-SNAPSHOT
OpenAPI declaration file content or url

https://docs.docker.com/engine/api/v1.39/swagger.yaml

Command line used for generation
docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i https://docs.docker.com/engine/api/v1.39/swagger.yaml -g haskell-http-client -o /local
Steps to reproduce
> mkdir openapi-docker
> cd openapi-docker
> docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate -i https://docs.docker.com/engine/api/v1.39/swagger.yaml -g haskell-http-client -o /local
> stack haddock
Related issues/PRs

Not found any.

Suggest a fix
Perhaps you meant ‘A.Array’ (imported from Data.Aeson)
Perhaps you want to add ‘Array’ to the import list in the import of
    ‘Data.Aeson’ (lib/DockerEngine/Model.hs:34:1-41).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Generate the Docker API client with the provided openapi-generator command, then run stack haddock to reproduce the failure. Inspect lib/DockerEngine/Model.hs and its Data.Aeson import around the reported Array reference; done means the generated Haskell client builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, haskell
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.