Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OCaml] Code generation fixes #12395

Merged
merged 2 commits into from
May 26, 2022
Merged

Conversation

MisterDA
Copy link
Contributor

The bugs were discovered using the Docker spec.

The Lwt module has functions that might shadow parameters, and all the functions we use from Lwt are in Lwt.Infix too.

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

ref #9787

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@cgensoul

The Lwt module has functions that might shadow parameters, and all the
functions we use from Lwt are in Lwt.Infix too.

    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
@MisterDA MisterDA changed the title OCaml code generation fixes [OCaml] Code generation fixes May 18, 2022
@wing328 wing328 added this to the 6.0.0 milestone May 18, 2022
@wing328 wing328 modified the milestones: 6.0.0, 6.0.1 May 26, 2022
@wing328
Copy link
Member

wing328 commented May 26, 2022

Tests are ok:

➜  ocaml git:(MisterDA-ocaml-fixes) eval $(opam env)
➜  ocaml git:(MisterDA-ocaml-fixes) dune build

@wing328 wing328 merged commit 5cce050 into OpenAPITools:master May 26, 2022
@MisterDA MisterDA deleted the ocaml-fixes branch May 26, 2022 15:54
@MisterDA
Copy link
Contributor Author

Thanks for merging!
Please note that this PR doesn't completely fix the OCaml codegen, there's still one bug listed here.

@wing328
Copy link
Member

wing328 commented May 26, 2022

FYI. I've merged #12477 to fix the installation instruction.

For #9787 (comment), is that still an issue with the latest master (we fixed some issue recently with the inline model resolver) ?

@MisterDA
Copy link
Contributor Author

For #9787 (comment), is that still an issue with the latest master (we fixed some issue recently with the inline model resolver) ?

They probably fixed earlier issues with OCaml codegen (thanks for that!), but this last one is still present with latest master (129fd0a).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants