[HASKELL] Generated types do not produce/consume JSON according to spec
#3.033 aberto em 2 de jun. de 2016
Métricas do repositório
- Stars
- (12.701 stars)
- Métricas de merge de PR
- (Nenhuma PRs mesclada em 30d)
Description
Description
In a Swagger spec file, when specifying eg. "payment_data" as a field name in an object, the resulting Haskell type produces (and consumes) JSON with a field name of "PaymentData". So eg. "channel_value_left" becomes "ChannelValueLeft". This breaks compatibility with the client library.
Swagger-codegen version
master @ a3610f1c12e5d7912cf2e9f16dff2152ef40291b
Swagger declaration file content or url
https://gist.github.com/runeksvendsen/305a3018fe48723998851419c2e4393d
Command line used for generation
$ java -jar swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -l haskell -i swagger.yaml
$ java -version
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
Steps to reproduce
wget https://gist.githubusercontent.com/runeksvendsen/305a3018fe98851419c2e4393d/raw/5d022bdef0355128c54d2235ea986aa84efa3e3e/swagger.yaml
java -jar swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -l haskell -i swagger.yaml
cat lib/BitcoinPaymentChannelRESTProtocol/Types.hs
Suggest a Fix
Perhaps add a config option like the modelPropertyNaming option that typescript-node has, which allows choosing word separation semantics ('camelCase', 'PascalCase', 'snake_case' etc.).