[BUG][ELIXIR] JIRA API OpenApi spec generates uncompilable code
Created by: cro
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
I am trying to generate an Elixir client for the Jira API. The generation completes, but I cannot compile the resuliting project.
openapi-generator version
I tried with current stable and the latest. I am using the docker container version.
OpenAPI declaration file content or url
https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json
Generation Details
docker run --rm -v "$PWD:/local" openapitools/openapi-generator-cli:latest generate \
-i https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json \
-g elixir \
-o /local/out/elixir
cd out/elixir
mix deps.get
mix compile
Steps to reproduce
docker run --rm -v "$PWD:/local" openapitools/openapi-generator-cli:latest generate \
-i https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json \
-g elixir \
-o /local/out/elixir
cd out/elixir
mix deps.get
mix compile
results in
== Compilation error in file lib/the_jira_cloud_platform_restapi/api/issue_properties.ex ==
** (CompileError) lib/the_jira_cloud_platform_restapi/api/issue_properties.ex:213: TheJiraCloudPlatformRESTAPI.Model.AnyType.__struct__/1 is undefined, cannot expand struct TheJiraCloudPlatformRESTAPI.Model.AnyType. Make sure the struct name is correct. If the struct name exists and is correct but it still cannot be found, you likely have cyclic module usage in your code
(stdlib 3.15) lists.erl:1358: :lists.mapfoldl/3
(stdlib 3.15) lists.erl:1359: :lists.mapfoldl/3
(elixir 1.12.3) expanding macro: Kernel.|>/2
Suggest a fix
This is my first experience with generating client code with openapi-generator. The validator suggested in the issue template says the .json spec is valid, but it can't be displayed because there are circular references. Is the Elixir plugin for openapi-generator unable to resolve this kind of situation?