From 9be5b9926694f929c450040312d7b90fde625b0d Mon Sep 17 00:00:00 2001 From: Jon Schoning <jonschoning@gmail.com> Date: Thu, 8 Nov 2018 15:47:47 -0600 Subject: [PATCH] [haskell-http-client] fix typename generation bug for array params; update deps - fix build for example-app + tests-integration in Samples (due to change in Category) - upgrade stack to 12.18 - fix typename generation bug for array params --- .../codegen/languages/HaskellHttpClientCodegen.java | 2 +- .../src/main/resources/haskell-http-client/stack.mustache | 4 ++-- .../client/petstore/haskell-http-client/example-app/Main.hs | 2 +- samples/client/petstore/haskell-http-client/stack.yaml | 4 ++-- .../haskell-http-client/tests-integration/tests/Test.hs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java index 07fc3c52e00..ed410e8ddf5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/HaskellHttpClientCodegen.java @@ -891,7 +891,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC if (appendDataType && uniqueParamNameTypes.containsKey(paramNameType) && !isDuplicate(paramNameType, dataType)) { - paramNameType = paramNameType + dataType; + paramNameType = toTypeName("", paramNameType + dataType); } while (typeNames.contains(paramNameType)) { diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache index f396d4a2a89..c5f97455ec7 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/stack.mustache @@ -1,8 +1,8 @@ -resolver: lts-10.10 +resolver: lts-12.18 build: haddock-arguments: haddock-args: - "--odir=./docs" -extra-deps: [] +extra-deps: [ {{^x-useMonadLogger}}katip-0.5.5.1{{/x-useMonadLogger}} ] packages: - '.' diff --git a/samples/client/petstore/haskell-http-client/example-app/Main.hs b/samples/client/petstore/haskell-http-client/example-app/Main.hs index fa86cbbbe17..55b068c2b48 100644 --- a/samples/client/petstore/haskell-http-client/example-app/Main.hs +++ b/samples/client/petstore/haskell-http-client/example-app/Main.hs @@ -118,7 +118,7 @@ runPet mgr config = do -- updatePet let updatePetRequest = S.updatePet (S.ContentType S.MimeJSON) $ pet { S.petStatus = Just S.E'Status2'Available - , S.petCategory = Just (S.Category (Just 3) (Just "catname")) + , S.petCategory = Just (S.Category (Just 3) "catname") } _ <- S.dispatchLbs mgr config updatePetRequest diff --git a/samples/client/petstore/haskell-http-client/stack.yaml b/samples/client/petstore/haskell-http-client/stack.yaml index f396d4a2a89..d115cc3c3c2 100644 --- a/samples/client/petstore/haskell-http-client/stack.yaml +++ b/samples/client/petstore/haskell-http-client/stack.yaml @@ -1,8 +1,8 @@ -resolver: lts-10.10 +resolver: lts-12.18 build: haddock-arguments: haddock-args: - "--odir=./docs" -extra-deps: [] +extra-deps: [ katip-0.5.5.1 ] packages: - '.' diff --git a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs index fa8a2bf8ddc..b4fed835364 100644 --- a/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs +++ b/samples/client/petstore/haskell-http-client/tests-integration/tests/Test.hs @@ -122,7 +122,7 @@ testPetOps mgr config = let updatePetRequest = S.updatePet (S.ContentType S.MimeJSON) (pet { S.petStatus = Just S.E'Status2'Available - , S.petCategory = Just (S.Category (Just 3) (Just "catname")) + , S.petCategory = Just (S.Category (Just 3) "catname") }) updatePetResponse <- S.dispatchLbs mgr config updatePetRequest NH.responseStatus updatePetResponse `shouldBe` NH.status200 -- GitLab