[BUG][OCaml] Construction of multipart/form-data is incorrect
Hi and many thanks to all maintainers and workers on the OpenAPI initiative! This is a great effort :)
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
The template for OCaml client generation does not construct multipart/form-data
correctly. The incorect logic can be seen
It looks like it is instead producing x-www-form-urlencoded
data, but this still ends up being supplied as the body for POST requests specified as taking form-data.
openapi-generator version
Visible on head.
OpenAPI declaration file content or url
Any spec with something like
requestBody:
required: true
content:
multipart/form-data:
should produce a broken client, but you can see the incorrect logic from the source code.
Related issues/PRs
Suggest a fix
I have hit too many bugs in the generated OCaml library for me to have time to report them all. Other errors included incorret deserialization logid for data including the object
keyword and syntactically incorrect datatypes for endpoints taking no data.
I appologize for not having time to report all the details.
I recommend updating the tables on the OCaml client generation to mark it as unstable, and remove the claim to support multipart forms.
I am experimenting with a fix, but not thru the handlebars approach, which looks too brittle IMO. I'll update here if I produce anything that will be of general interest.