Skip to content

[BUG] [Elixir] faulty free-form object type specification #21112

@efcasado

Description

@efcasado

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

Using a free-form object as a request body

requestBody:
  content:
    application/json:
      schema:
        type: object

results in faulty type specifications in API modules.

@spec foo_post(Tesla.Env.client, %{optional(String.t) => }, keyword()) :: {:ok, nil} | {:error, Tesla.Env.t}

The faulty type specification results in the generated client not compiling.

openapi-generator version

7.12.0

OpenAPI declaration file content or url

Below is a minimal example that can be used to reproduce the issue

openapi: 3.0.0
info:
  version: 1.0.0
  title: A minimal OpenAPI example
paths:
  /foo:
    post:
      requestBody:
        content:
          application/json:
            schema:
              type: object
        required: true
      responses:
        "200":
          description: Successful operation
        "400":
          description: Invalid operation
Generation Details
openapi-generator-cli generate -i $(OAS_FILE) -g elixir -o local/out/elixir

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