{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/8914","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/8914/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/8914/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/8914/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/8914","id":380601296,"node_id":"MDU6SXNzdWUzODA2MDEyOTY=","number":8914,"title":"[HASKELL] Build failure with \"list\" type after generation","user":{"login":"hasufell","id":1241845,"node_id":"MDQ6VXNlcjEyNDE4NDU=","avatar_url":"https://avatars1.githubusercontent.com/u/1241845?v=4","gravatar_id":"","url":"https://api.github.com/users/hasufell","html_url":"https://github.com/hasufell","followers_url":"https://api.github.com/users/hasufell/followers","following_url":"https://api.github.com/users/hasufell/following{/other_user}","gists_url":"https://api.github.com/users/hasufell/gists{/gist_id}","starred_url":"https://api.github.com/users/hasufell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasufell/subscriptions","organizations_url":"https://api.github.com/users/hasufell/orgs","repos_url":"https://api.github.com/users/hasufell/repos","events_url":"https://api.github.com/users/hasufell/events{/privacy}","received_events_url":"https://api.github.com/users/hasufell/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-14T09:12:50Z","updated_at":"2018-11-20T00:55:18Z","closed_at":null,"author_association":"NONE","body":"##### Description\r\n\r\nHaskell GHC compiler fails to build the generated haskell code due to diverging data type names when the swagger type is `list`:\r\n\r\n```\r\n/home/maerwald/tmp/petstore/petstore/lib/SwaggerPetstore/API.hs:12:16: warning:\r\n    -fcontext-stack=328 is deprecated: use -freduction-depth=328 instead\r\n[1 of 2] Compiling SwaggerPetstore.Types ( lib/SwaggerPetstore/Types.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-1.24.2.0/build/SwaggerPetstore/Types.o )\r\n[2 of 2] Compiling SwaggerPetstore.API ( lib/SwaggerPetstore/API.hs, .stack-work/dist/x86_64-linux-tinfo6/Cabal-1.24.2.0/build/SwaggerPetstore/API.o )\r\n                                        \r\n/home/maerwald/tmp/petstore/petstore/lib/SwaggerPetstore/API.hs:67:43: error:\r\n    Not in scope: type constructor or class ‘List’\r\n    Perhaps you meant one of these:     \r\n      ‘List_’ (imported from SwaggerPetstore.Types),\r\n      ‘HList’ (imported from Servant.API)\r\n                                        \r\n/home/maerwald/tmp/petstore/petstore/lib/SwaggerPetstore/API.hs:130:19: error:\r\n    Not in scope: type constructor or class ‘List’\r\n    Perhaps you meant one of these:     \r\n      ‘List_’ (imported from SwaggerPetstore.Types),\r\n      ‘HList’ (imported from Servant.API)\r\nCompleted 74 action(s).                 \r\n\r\n--  While building package swagger-petstore-0.1.0.0 using:\r\n      /home/maerwald/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-1.24.2.0 build lib:swagger-petstore --ghc-options \" -ddump-hi -ddump-to-file\"\r\n    Process exited with code: ExitFailure 1\r\n```\r\n\r\nThe data type that is generated is:\r\n\r\n```hs\r\n-- | \r\ndata List_ = List_\r\n  { list_Id :: Integer -- ^ \r\n  , list_Name :: Text -- ^ \r\n  , list_Tag :: Text -- ^ \r\n  } deriving (Show, Eq, Generic)\r\n```\r\n\r\nBut the API will use:\r\n\r\n```hs\r\ndata SwaggerPetstoreBackend m = SwaggerPetstoreBackend\r\n  { petsGet :: m [List]{- ^ Returns all pets from the system that the user has access to -}\r\n  }\r\n```\r\n\r\nThe whole generated project can be viewed at https://github.com/hasufell/petstore-swagger-bug\r\n\r\n##### Swagger-codegen version\r\n\r\n`2.4.0-SNAPSHOT` built from git d9c4e014e6791072b1c71faa4a77098f9bdcc3a4\r\n\r\n##### Swagger declaration file content or url\r\n\r\nThis is derived from the minimal swagger petstore definition. The pet type has been renamed to `list`:\r\n\r\n```json\r\n{\r\n  \"swagger\": \"2.0\",\r\n  \"info\": {\r\n    \"version\": \"1.0.0\",\r\n    \"title\": \"Swagger Petstore\",\r\n    \"description\": \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\",\r\n    \"termsOfService\": \"http://swagger.io/terms/\",\r\n    \"contact\": {\r\n      \"name\": \"Swagger API Team\"\r\n    },\r\n    \"license\": {\r\n      \"name\": \"MIT\"\r\n    }\r\n  },\r\n  \"host\": \"petstore.swagger.io\",\r\n  \"basePath\": \"/api\",\r\n  \"schemes\": [\r\n    \"http\"\r\n  ],\r\n  \"consumes\": [\r\n    \"application/json\"\r\n  ],\r\n  \"produces\": [\r\n    \"application/json\"\r\n  ],\r\n  \"paths\": {\r\n    \"/pets\": {\r\n      \"get\": {\r\n        \"description\": \"Returns all pets from the system that the user has access to\",\r\n        \"produces\": [\r\n          \"application/json\"\r\n        ],\r\n        \"responses\": {\r\n          \"200\": {\r\n            \"description\": \"A list of pets.\",\r\n            \"schema\": {\r\n              \"type\": \"array\",\r\n              \"items\": {\r\n                \"$ref\": \"#/definitions/list\"\r\n              }\r\n            }\r\n          }\r\n        }\r\n      }\r\n    }\r\n  },\r\n  \"definitions\": {\r\n    \"list\": {\r\n      \"type\": \"object\",\r\n      \"required\": [\r\n        \"id\",\r\n        \"name\"\r\n      ],\r\n      \"properties\": {\r\n        \"id\": {\r\n          \"type\": \"integer\",\r\n          \"format\": \"int64\"\r\n        },\r\n        \"name\": {\r\n          \"type\": \"string\"\r\n        },\r\n        \"tag\": {\r\n          \"type\": \"string\"\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\n##### Command line used for generation\r\n\r\n```sh\r\njava -jar \"modules/swagger-codegen-cli/target/swagger-codegen-cli.jar\" generate -i petstore-minimal.json     -l haskell -o petstore\r\n```\r\n\r\n##### Steps to reproduce\r\n\r\nAfter generation, run:\r\n\r\n* `stack build`"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/440096677","html_url":"https://github.com/swagger-api/swagger-codegen/issues/8914#issuecomment-440096677","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/8914","id":440096677,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDA5NjY3Nw==","user":{"login":"adamConnerSax","id":13699751,"node_id":"MDQ6VXNlcjEzNjk5NzUx","avatar_url":"https://avatars0.githubusercontent.com/u/13699751?v=4","gravatar_id":"","url":"https://api.github.com/users/adamConnerSax","html_url":"https://github.com/adamConnerSax","followers_url":"https://api.github.com/users/adamConnerSax/followers","following_url":"https://api.github.com/users/adamConnerSax/following{/other_user}","gists_url":"https://api.github.com/users/adamConnerSax/gists{/gist_id}","starred_url":"https://api.github.com/users/adamConnerSax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamConnerSax/subscriptions","organizations_url":"https://api.github.com/users/adamConnerSax/orgs","repos_url":"https://api.github.com/users/adamConnerSax/repos","events_url":"https://api.github.com/users/adamConnerSax/events{/privacy}","received_events_url":"https://api.github.com/users/adamConnerSax/received_events","type":"User","site_admin":false},"created_at":"2018-11-20T00:55:18Z","updated_at":"2018-11-20T00:55:18Z","author_association":"NONE","body":"I think I fixed this one as well.  Just involved removing \"List\" as a reserved word.  There's what I think is a working version at the link above if you just need it to work.  I'm not submitting the new version as a PR to swagger-codegen until I check some more things and get someone with more (read: any) servant experience to check that I haven't caused new issues."}}
{"actor":{"display_login":"adamConnerSax"}}