Skip to content

Commit 4d152cb

Browse files
sir4ur0nkpy3
authored andcommitted
Add the dependencies in the generated Opam file (OpenAPITools#20805)
1 parent 274f135 commit 4d152cb

File tree

5 files changed

+40
-13
lines changed

5 files changed

+40
-13
lines changed

.github/workflows/samples-ocaml.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ jobs:
2626
- name: Install
2727
run: opam install . --deps-only --with-test
2828
working-directory: ${{ matrix.sample }}
29-
- name: Install Misc
30-
run: opam install dune ppx_deriving_yojson conf-libev lwt cohttp-lwt-unix.5.3.0 cohttp-async.5.3.0
31-
working-directory: ${{ matrix.sample }}
3229
- name: Build
3330
run: opam exec -- dune build
3431
working-directory: ${{ matrix.sample }}

modules/openapi-generator/src/main/resources/ocaml/lib.mustache

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,14 @@ license: ""
1111
homepage: ""
1212
bug-reports: ""
1313
dev-repo: ""
14-
depends: [ "ocaml" "ocamlfind" ]
15-
build: ["dune" "build" "-p" name]
14+
depends: [
15+
"ocaml"
16+
"ocamlfind"
17+
"dune"
18+
"ppx_deriving_yojson"
19+
"conf-libev"
20+
"lwt"
21+
"cohttp-lwt-unix" {< "6.0.0"}
22+
"cohttp-async" {< "6.0.0"}
23+
]
24+
build: ["dune" "build" "-p" name]

modules/openapi-generator/src/main/resources/ocaml/readme.mustache

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,24 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
1818

1919
## Requirements.
2020

21-
OCaml 4.x
21+
OCaml 5.x
2222

2323
## Installation
2424

2525
Please run the following commands to build the package `{{{packageName}}}`:
2626

2727
```sh
28-
opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix ocaml-migrate-parsetree
28+
opam install . --deps-only --with-test
2929
eval $(opam env)
3030
dune build
3131
```
3232

3333
## Getting Started
3434

35-
TODO
35+
The generated directory structure is:
36+
- `src/apis`: contains several modules, each with several functions. Each function is an API endpoint.
37+
- `src/models`: contains several modules. Each module contains:
38+
- a type `t` representing an input and/or output schema of the OpenAPI spec
39+
- a smart constructor `create` for this type
40+
- `src/support`: various modules used by the generated APIs and Models
41+

samples/client/petstore/ocaml/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,24 @@ This OCaml package is automatically generated by the [OpenAPI Generator](https:/
1010

1111
## Requirements.
1212

13-
OCaml 4.x
13+
OCaml 5.x
1414

1515
## Installation
1616

1717
Please run the following commands to build the package `petstore_client`:
1818

1919
```sh
20-
opam install ppx_deriving_yojson cohttp ppx_deriving cohttp-lwt-unix ocaml-migrate-parsetree
20+
opam install . --deps-only --with-test
2121
eval $(opam env)
2222
dune build
2323
```
2424

2525
## Getting Started
2626

27-
TODO
27+
The generated directory structure is:
28+
- `src/apis`: contains several modules, each with several functions. Each function is an API endpoint.
29+
- `src/models`: contains several modules. Each module contains:
30+
- a type `t` representing an input and/or output schema of the OpenAPI spec
31+
- a smart constructor `create` for this type
32+
- `src/support`: various modules used by the generated APIs and Models
33+

samples/client/petstore/ocaml/petstore_client.opam

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,14 @@ license: ""
1111
homepage: ""
1212
bug-reports: ""
1313
dev-repo: ""
14-
depends: [ "ocaml" "ocamlfind" ]
15-
build: ["dune" "build" "-p" name]
14+
depends: [
15+
"ocaml"
16+
"ocamlfind"
17+
"dune"
18+
"ppx_deriving_yojson"
19+
"conf-libev"
20+
"lwt"
21+
"cohttp-lwt-unix" {< "6.0.0"}
22+
"cohttp-async" {< "6.0.0"}
23+
]
24+
build: ["dune" "build" "-p" name]

0 commit comments

Comments
 (0)