swagger-api / swagger-api/swagger-codegen

[Haskell] codegen generates fields of type `Date` without importing or declaring `Date`

Open
#8,848 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Haskell codegen will generate fields of type Date, but will not import or declare Date, leading to stack build failing with errors like Not in scope: type constructor or class ‘Date’.

Swagger-codegen version

2.3.1

Swagger declaration file content or url

http://api.open.fec.gov/swagger

Command line used for generation

swagger-codegen generate -i http://api.open.fec.gov/swagger -l haskell

Steps to reproduce

Assuming haskell-stack installed:

swagger-codegen generate -i http://api.open.fec.gov/swagger -l haskell

stack build

Related issues/PRs

None found

Suggest a fix/enhancement

Generate type Day instead of Date and import Day from package time module Data.Time.

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

Reproduce the failure with swagger-codegen generate -i http://api.open.fec.gov/swagger -l haskell, then run stack build and inspect the generated Haskell code and the Haskell codegen entry point. Done means generated fields use a defined and imported date type so stack build succeeds.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.