Skip to content

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

@mbj

Description

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions