andrenth / ocaml-swagger

Swagger 2.0 code generator for OCaml
37 stars 10 forks source link

Add extra unit after named arguments in val.ml. #1

Closed rizo closed 6 years ago

rizo commented 6 years ago

This PR adds an extra unit after non-optional named arguments.

See issue https://github.com/andrenth/kubecaml/issues/2 for motivation.

This behaviour is consistent with the popular deriving make ppx.

Another minor thing: would you consider renaming the create function make to make it even more consistent? :)

andrenth commented 6 years ago

Thanks for the PR! I wouldn't mind renaming create to make, but isn't create the most commonly used name for constructors in OCaml?

rizo commented 6 years ago

@andrenth Unfortunately the Stdlib is inconsistent with regards to constructor function naming so it's hard to say. Specifically the Array, Bytes and String modules have make, create and init functions. The Array.create function is deprecated though.

I think the deriving make ppx is very popular so I'd assume most people use make. I'm using kubecaml with Reason where make seems to be a standard convention.

andrenth commented 6 years ago

Well, I’m fine with either. If you want to create a PR switching to deriving make I’ll accept it.

rizo commented 6 years ago

I'll try to do that when I have time! Thanks!