4 ms·
If you want to access RESTful APIs via OCaml, you may consider using OpenAPI Generator to generate the OCaml client automatically instead of manually creating o
by wing328hk 7y ago
If you want to access RESTful APIs via OCaml, you may consider using OpenAPI Generator to generate the OCaml client automatically instead of manually creating one. Here are 3 simple steps to do so:
1. Download the OpenAPI Generator CLI Java JAR (https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.2.3/openapi-generator-cli-4.2.3.jar https://repo1.maven.org/maven2/org/openapitools/openapi-gene...)
2. Rename the JAR as "openapi-generator-cli.jar"
3. Run the following command to generate an OCaml API client for the Petstore API (https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml https://raw.githubusercontent.com/OpenAPITools/openapi-gener...):
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 https://raw.githubusercontent.com/OpenAPITools/openapi-gener... -o /var/tmp/ocaml/
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 https://raw.githubusercontent.com/OpenAPITools/openapi-gener... -o C:\tmp\ocaml
If you've any feedback or question, please let us know via https://github.com/OpenAPITools/openapi-generator/issues/new https://github.com/OpenAPITools/openapi-generator/issues/new