OpenAPITools / OpenAPITools/openapi-generator

[BUG] [Elm] String Type schemas cause the Data.elm to not be generated

Open
#10,398 6 comments 1 reaction 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

The elm generator doesn't create a Data.elm in src/Api/ which leads to non-compiling code if the api spec contains a schema which is simply a string (see provided gist).

openapi-generator version
openapi-generator-cli 5.2.0
  commit : 90f7bcd
  built  : 2021-07-09T09:41:46Z
  source : https://github.com/openapitools/openapi-generator
  docs   : https://openapi-generator.tech/

Not sure if this worked at some point.

OpenAPI declaration file content or url

A minimal example can be seen here: https://gist.github.com/alehed/e5eb44e14f0dcf38a430421e62f9aa12

Generation Details
openapi-generator-cli generate -i https://gist.githubusercontent.com/alehed/e5eb44e14f0dcf38a430421e62f9aa12/raw/e57d418eeebc8f3553a815522401047c7cebec5a/swapi-dummy.yaml -g elm -o generated
Steps to reproduce

Run the above command and inspect the generated folder.

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

Run the provided openapi-generator-cli command with the linked minimal specification, then inspect the generated folder and the Elm generator's handling of string-only schemas. Confirm the missing src/Api/Data.elm and trace why dependent generated code is not compilable. Done means the same specification generates Data.elm and the resulting Elm project compiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
elm
Domain
api, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.