Skip to content

[BUG][OCaml] Object with additionalProperties: true (free-form object) becomes Any_type.t which does not exist #21312

@sir4ur0n

Description

@sir4ur0n

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator?
  • 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

If a schema contains

{
  "type": "object",
  "additionalProperties": true
}

(called free-form objects) then it becomes (string * Any_type.t) list which does not exist, instead of (string * Yojson.Safe.t) list.

openapi-generator version

7.12.0

OpenAPI declaration file content or url

https://api.integration.app/docs-json

In particular:

        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        }
Generation Details
$ openapi-generator-cli generate \
  --generator-name ocaml \
  --input-spec docs-json
Steps to reproduce
$ openapi-generator-cli generate \
  --generator-name ocaml \
  --input-spec docs-json
Related issues/PRs

None.

Suggest a fix

Replace Any_type.t with Yojson.Safe.t

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions