OpenAPITools / OpenAPITools/openapi-generator

[BUG] Elixir - api_clients/clients/elixir/lib/docspring/connection.ex has syntax errors

Open
#20,562 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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
Compiling 70 files (.ex)

== Compilation error in file lib/docspring/connection.ex ==
** (MismatchedDelimiterError) mismatched delimiter found on lib/docspring/connection.ex:90:45:
    error: unexpected token: )
    │
  4 │ defmodule Docspring.Connection do
    │                                └ unclosed delimiter
 ...
 90 │   @spec new(String.t(), String.t()), options) :: Tesla.Env.client()
    │                                             └ mismatched closing delimiter (expected "end")
    │
    └─ lib/docspring/connection.ex:90:45
    (elixir 1.18.2) lib/kernel/parallel_compiler.ex:428: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/8
F
openapi-generator version

7.11.0

OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix

From ChatGPT:

  1. Incorrect @spec Syntax for new/3 Function

Issue: The @spec for the new/3 function has an extra parenthesis, making it invalid.

@spec new(String.t(), String.t()), options) :: Tesla.Env.client()

Fix: Remove the extra parenthesis and ensure all parameters are included correctly. Additionally, update the return type to Tesla.Client.t() which is the standard type for Tesla clients.

There might be some other problems too

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with api_clients/clients/elixir/lib/docspring/connection.ex and reproduce the Elixir compilation error at line 90. Inspect the malformed @spec for new/3 and any other reported syntax problems; done means the generated client compiles without the mismatched-delimiter error.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.