Haskell-OpenAPI-Code-Generator / Haskell-OpenAPI-Client-Code-Generator

Generate Haskell client code from an OpenAPI 3 specification
46 stars 19 forks source link

Add support for objects and arrays in parameters #19

Closed joel-bach closed 4 years ago

joel-bach commented 4 years ago
joel-bach commented 4 years ago

And closes this issue as well: https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator/issues/11

joel-bach commented 4 years ago

@NorfairKing You can see the main changes in the golden tests, especially in the file https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator/blob/6369c39b1001133bfabed000b93e363030a3f807/.circleci/golden/expected/src/OpenAPI/Operations/MultiParam.hs where you can see how parameters are bundled into a new type (on line 97).

I will not publish a new version of the Stripe library until I have finished the most important issues if this is fine with you. IMO, these would be the issues https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator/issues/18, https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator/issues/14 and https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator/issues/9, as they all introduce breaking changes to the Stripe API.

NorfairKing commented 4 years ago

Alright this looks good! But how do we know if the generated code works?

joel-bach commented 4 years ago

Well, it passes the automated tests which include some of the new encodings. But there is definitely room for improvement. If Stripe actually accepts everything is something which is probably the easiest to test with your production code. If you do not have a reason to wait, I will merge this PR and start working on the other issues.

NorfairKing commented 4 years ago

Feel free to merge! No need to test in prod. I can test in staging or even locally, with stripe's test objects.