We’ve added the OCaml client generator to the OpenAPI Generator project. To generate an OCaml client given an OpenAPI/Swagger specification file, please follow 3 simple steps below:
- Download the Java JAR https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.1.0-SNAPSHOT/openapi-generator-cli-4.1.0-20190729.024538-72.jar
- Rename the JAR as “openapi-generator-cli.jar”
- Run the following command to generate an OCaml API client for the Petstore API:
Mac/Linux:
- java -jar openapi-generator-cli.jar generate -g ocaml -i https:// raw.githubusercontent .com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o /var/tmp/ocaml
(please remove spaces in the URL as I can only share 2 URLs in a new post)
Windows:
- java -jar openapi-generator-cli.jar generate -g ocaml -i https:// raw.githubusercontent .com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o C:\tmp\ocaml
(please remove spaces in the URL as I can only share 2 URLs in a new post)
If you’ve any feedback or question, please let us know by opening an issue in the Github repo.
Thanks Christophe Gensoul for contributing the new generator (https://github.com/OpenAPITools/openapi-generator/pull/3446).