diff --git a/.github/workflows/samples-ocaml.yaml b/.github/workflows/samples-ocaml.yaml index 1f03811073a..79507c281dc 100644 --- a/.github/workflows/samples-ocaml.yaml +++ b/.github/workflows/samples-ocaml.yaml @@ -26,9 +26,6 @@ jobs: - name: Install run: opam install . --deps-only --with-test working-directory: ${{ matrix.sample }} - - name: Install Misc - run: opam install dune ppx_deriving_yojson conf-libev lwt cohttp-lwt-unix.5.3.0 cohttp-async.5.3.0 - working-directory: ${{ matrix.sample }} - name: Build run: opam exec -- dune build working-directory: ${{ matrix.sample }} diff --git a/modules/openapi-generator/src/main/resources/ocaml/lib.mustache b/modules/openapi-generator/src/main/resources/ocaml/lib.mustache index 627f3227880..017bf839c43 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/lib.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/lib.mustache @@ -11,5 +11,14 @@ license: "" homepage: "" bug-reports: "" dev-repo: "" -depends: [ "ocaml" "ocamlfind" ] -build: ["dune" "build" "-p" name] \ No newline at end of file +depends: [ + "ocaml" + "ocamlfind" + "dune" + "ppx_deriving_yojson" + "conf-libev" + "lwt" + "cohttp-lwt-unix" {< "6.0.0"} + "cohttp-async" {< "6.0.0"} +] +build: ["dune" "build" "-p" name] diff --git a/modules/openapi-generator/src/main/resources/ocaml/readme.mustache b/modules/openapi-generator/src/main/resources/ocaml/readme.mustache index 6e4bb85d440..ad185f53440 100644 --- a/modules/openapi-generator/src/main/resources/ocaml/readme.mustache +++ b/modules/openapi-generator/src/main/resources/ocaml/readme.mustache @@ -18,18 +18,24 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) ## Requirements. -OCaml 4.x +OCaml 5.x ## Installation Please run the following commands to build the package `{{{packageName}}}`: ```sh -opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix ocaml-migrate-parsetree +opam install . --deps-only --with-test eval $(opam env) dune build ``` ## Getting Started -TODO +The generated directory structure is: +- `src/apis`: contains several modules, each with several functions. Each function is an API endpoint. +- `src/models`: contains several modules. Each module contains: + - a type `t` representing an input and/or output schema of the OpenAPI spec + - a smart constructor `create` for this type +- `src/support`: various modules used by the generated APIs and Models + diff --git a/samples/client/petstore/ocaml/README.md b/samples/client/petstore/ocaml/README.md index 4fd349fba16..070ac384189 100644 --- a/samples/client/petstore/ocaml/README.md +++ b/samples/client/petstore/ocaml/README.md @@ -10,18 +10,24 @@ This OCaml package is automatically generated by the [OpenAPI Generator](https:/ ## Requirements. -OCaml 4.x +OCaml 5.x ## Installation Please run the following commands to build the package `petstore_client`: ```sh -opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix ocaml-migrate-parsetree +opam install . --deps-only --with-test eval $(opam env) dune build ``` ## Getting Started -TODO +The generated directory structure is: +- `src/apis`: contains several modules, each with several functions. Each function is an API endpoint. +- `src/models`: contains several modules. Each module contains: + - a type `t` representing an input and/or output schema of the OpenAPI spec + - a smart constructor `create` for this type +- `src/support`: various modules used by the generated APIs and Models + diff --git a/samples/client/petstore/ocaml/petstore_client.opam b/samples/client/petstore/ocaml/petstore_client.opam index 3c3603c2f14..7ca31fc5af4 100644 --- a/samples/client/petstore/ocaml/petstore_client.opam +++ b/samples/client/petstore/ocaml/petstore_client.opam @@ -11,5 +11,14 @@ license: "" homepage: "" bug-reports: "" dev-repo: "" -depends: [ "ocaml" "ocamlfind" ] -build: ["dune" "build" "-p" name] \ No newline at end of file +depends: [ + "ocaml" + "ocamlfind" + "dune" + "ppx_deriving_yojson" + "conf-libev" + "lwt" + "cohttp-lwt-unix" {< "6.0.0"} + "cohttp-async" {< "6.0.0"} +] +build: ["dune" "build" "-p" name]