Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][haskell-http-client] --name-mappings is not applied to property names #18943

Closed
valpackett opened this issue Jun 16, 2024 · 0 comments · Fixed by #18944
Closed

[BUG][haskell-http-client] --name-mappings is not applied to property names #18943

valpackett opened this issue Jun 16, 2024 · 0 comments · Fixed by #18944

Comments

@valpackett
Copy link
Contributor

Description

With a field that's named _ (single underscore), the Haskell http-client generator generates a name collision due to stripping underscores without considering this:

-- * TestGet200Response

-- | 'testGet200ResponseOuter' Lens
testGet200ResponseOuterL :: Lens_' TestGet200Response (Maybe TestGet200ResponseOuter)
testGet200ResponseOuterL f TestGet200Response{..} = (\testGet200ResponseOuter -> TestGet200Response { testGet200ResponseOuter, ..} ) <$> f testGet200ResponseOuter
{-# INLINE testGet200ResponseOuterL #-}



-- * TestGet200ResponseOuter

-- | 'testGet200ResponseOuter' Lens
testGet200ResponseOuterL :: Lens_' TestGet200ResponseOuter (Maybe [Text])
testGet200ResponseOuterL f TestGet200ResponseOuter{..} = (\testGet200ResponseOuter -> TestGet200ResponseOuter { testGet200ResponseOuter, ..} ) <$> f testGet200ResponseOuter
{-# INLINE testGet200ResponseOuterL #-}

And name-mappings don't apply so that workaround is not available.

openapi-generator version

989a798

OpenAPI declaration file content or url
openapi: '3.0.0'
info:
  version: 1.0.0
  title: test
paths:
  /test:
    get:
      summary: sample
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  outer:
                    type: object
                    properties:
                      '_':
                        type: array
                        items:
                          type: "string"
Generation Details
java -jar /home/val/.m2/repository/org/openapitools/openapi-generator-cli/7.7.0-SNAPSHOT/openapi-generator-cli-7.7.0-SNAPSHOT.jar generate -i spec.yaml -o out -g haskell-http-client --name-mappings _=underscore
Steps to reproduce

Try the spec from above.

Related issues/PRs
Suggest a fix

Will look into it myself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant