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
  • #2968
Closed
Open
Issue created May 21, 2019 by Administrator@rootContributor5 of 5 checklist items completed5/5 checklist items

[BUG][Haskell] servant-client integration generates syntax error on the stripe spec.

Created by: mbj

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
Description

Using the servant-client generator, code that has a syntax error gets generated.

openapi-generator version

4.0.0

OpenAPI declaration file content or url

https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json

Steps to reproduce
wget https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json
# that one fails as its not a valid spec
java -jar openapi-generator-cli-4.0.0.jar generate -i spec3.json -g haskell
# skipping validation
java -jar openapi-generator-cli-4.0.0.jar generate -i spec3.json--skip-validate-spec -g haskell
# stack build
[snip]
[1 of 2] Compiling Stripe.Types     ( lib/Stripe/Types.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/Stripe/Types.o )
                            
/home/mrh-dev/devel/test/lib/Stripe/Types.hs:603:55: error: parse error on input ‘;’
    |                       
603 |   { accountBusinessUnderscoreprofile :: Maybe AnyOf<accountBusinessProfile> -- ^ Optional information related to the business.
    | 
Other notes

The stripe spec is not valid, but AFAIK the generator skips over the invalid parts. So the syntax error could or could not relate to the "invalidness".

Related issues/PRs

could find none.

Suggest a fix

Sorry, my familiarity with this code base is too low to recommend a good one. I suspect that java syntax somehow leaks into the haskell gennerator, the escaped < and > could be java generics syntax.

Assignee
Assign to
Time tracking