Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/samples-ocaml.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
13 changes: 11 additions & 2 deletions modules/openapi-generator/src/main/resources/ocaml/lib.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,14 @@ license: ""
homepage: ""
bug-reports: ""
dev-repo: ""
depends: [ "ocaml" "ocamlfind" ]
build: ["dune" "build" "-p" name]
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]
Original file line number Diff line number Diff line change
Expand Up @@ -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

12 changes: 9 additions & 3 deletions samples/client/petstore/ocaml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

13 changes: 11 additions & 2 deletions samples/client/petstore/ocaml/petstore_client.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,14 @@ license: ""
homepage: ""
bug-reports: ""
dev-repo: ""
depends: [ "ocaml" "ocamlfind" ]
build: ["dune" "build" "-p" name]
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]
Loading