Created by: cgensoul
#1159 (closed) Add OCaml client code generation support
This PR answers #1159 (closed) and adds OCaml Client code generation to openapi-generator. The generated OCaml project relies on the dune tool for the build process and uses :
- cohttp as the http client lib using the lwt_unix backend (lwt is a future lib for OCaml, a competing future lib is Async which Cohttp supports as well but this generator only target the lwt implementation for now)
- yojson as the JSon serialization lib
- ppx_deriving_yojson for automatic generation of JSon serializers and deserializers for generated types
- ppx_deriving.std for automatic generation of string convertion functions for generated types
It supports headers params, path params, query params, form params and body params. It currently has no support for authentication, nor file upload.
It generates one model file per OAS definition except for OAS enum definitions for which no model file is generated. Enums are treated globally and are all generated in a enums.ml file that contains one type per distinct enumeration present in the input file, even for enumerations that are not proper definitions but just local restrictions on a string parameter of an operation.
For APIs files, both an implementation (.ml) and an interface (.mli) files are generated.