[BUG][OCaml] multiple errors in generated OCaml from Docker Engine API
Created by: MisterDA
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
Have you tested with the latest master to confirm the issue still exists? -
Have you searched for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
I'm trying to generate the OCaml package for the Docker Remote API, v 1.41.
openapi-generator version
Latest master, 77e1ca56.
OpenAPI declaration file content or url
https://docs.docker.com/engine/api/v1.41.yaml
Generation Details
File "src/apis/config_api.mli", line 8, characters 43-45:
8 | val config_create : body:UNKNOWN_BASE_TYPE -> unit -> Id_response.t Lwt.t
^^
Error: Syntax error
File "src/apis/container_api.mli", line 13, characters 46-48:
13 | val container_create : body:UNKNOWN_BASE_TYPE -> ?name:string -> unit -> Container_create_response.t Lwt.t
^^
Error: Syntax error
File "src/apis/secret_api.mli", line 8, characters 43-45:
8 | val secret_create : body:UNKNOWN_BASE_TYPE -> unit -> Id_response.t Lwt.t
^^
Error: Syntax error
File "src/apis/service_api.mli", line 8, characters 44-46:
8 | val service_create : body:UNKNOWN_BASE_TYPE -> ?x_registry_auth:string -> unit -> Service_create_response.t Lwt.t
^^
Error: Syntax error
File "src/apis/image_api.ml", line 13, characters 69-72:
13 | let uri = Request.maybe_add_query_param uri "all" string_of_bool all in
^^^
Error: This expression has type 'a t list -> 'a list t
but an expression was expected of type bool option
File "src/apis/plugin_api.ml", line 22, characters 52-56:
22 | Cohttp_lwt_unix.Client.call `POST uri ~headers ~body >>= fun (resp, body) ->
^^^^
Error: This expression has type 'a -> Cohttp_lwt.Body.t
but an expression was expected of type Cohttp_lwt.Body.t
File "src/models/system_data_usage_response.ml", line 11, characters 16-23:
11 | containers: Array.t list;
^^^^^^^
Error: The type constructor Array.t expects 1 argument(s),
but is here applied to 0 argument(s)
Steps to reproduce
Using OCaml 4.12.
# have build latest openapi-generator
java -jar openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i https://docs.docker.com/engine/api/v1.41.yaml -g ocaml -o ../ocaml-docker-api
cd ../ocaml-docker-api
dune build @all
Related issues/PRs
-
The UNKNOWN_BASE_TYPE
was already reported at https://github.com/OpenAPITools/openapi-generator/issues/8398.
Suggest a fix
ping @cgensoul @davesnx.