Skip to content

[BUG] Elm Discriminator generates non-existent exports #16104

Open
@TheOddler

Description

@TheOddler

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

When generating Elm code for something that uses a discriminator it add some non-existent things to the exposing (...) list in the Data.elm file.

openapi-generator version

6.6.0

❯ openapi-generator-cli --version
openapi-generator-cli 6.6.0
  commit : 7f8b853
  built  : -999999999-01-01T00:00:00+18:00
  source : https://github.com/openapitools/openapi-generator
  docs   : https://openapi-generator.tech/
OpenAPI declaration file content or url

https://gist.github.com/TheOddler/6cc108f76c5c123900f9741af0bb408b

Generation Details
❯ openapi-generator-cli generate -g elm -i backend/openapi/openapi-bug-mininal.json -o frontend/generated
Steps to reproduce
  1. Download the above linked content, and generate elm code from it.
  2. Open the src/Api/Data.elm file
  3. See that it added ExampleTag(..) and exampleTagVariants to the exposed stuff
  4. Notice that neither of those actually exist in the file anywhere else
Related issues/PRs
Suggest a fix

I think those two exports should just not be added, then everything works (at least manually doing that seems to have fixed it for me).

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