swagger-api / swagger-api/swagger-codegen
[Haskell] Converting underscores to `'Underscore` seems unnecessary
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
swagger-codegen for Haskell converts underscores to 'Underscore, which seems unnecessary as _ is valid Haskell identifier syntax. As underscores seem to be quite commonly used this can severely negatively impact the readability of generated code / code that uses it.
Swagger-codegen version
2.3.1
Swagger declaration file content or url
Any swagger declaration with underscores in it.
Command line used for generation
swagger-codegen generate -i <any_declaration_with_underscores> -l haskell
Steps to reproduce
Run: swagger-codegen generate -i <any_declaration_with_underscores> -l haskell
Look at generated Types.hs file and observe the large amounts of 'Underscore.
Related issues/PRs
Could not find any.
Suggest a fix/enhancement
Add specialCharReplacements.remove("_"); to https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/HaskellServantCodegen.java#L51 method.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect HaskellServantCodegen.java around line 51, then reproduce the issue with the provided generate command and a Swagger declaration containing underscores. Check the generated Types.hs output; done means valid underscores are no longer rendered as repeated 'Underscore text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell, java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100