Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #9787
Closed
Open
Issue created Jun 16, 2021 by Administrator@rootContributor4 of 7 checklist items completed4/7 checklist items

[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.

Assignee
Assign to
Time tracking