Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #10755
Closed
Open
Issue created Nov 01, 2021 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[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?

Assignee
Assign to
Time tracking