OpenAPITools / OpenAPITools/openapi-generator

[BUG][Swift5] support of type Array in oneOf

Open
#9,785 3 comments 2 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

Tried on master (currently 5.2.0), confirmed that array in "one of" not supported..
Add code-generation support for array type in OneOf..
e.g.

Expected in generated code:

....
case typeArray([MyArray])`
....

for *.YAML - file:

....
oneOf:
     -
        type: array
        items:
            $ref: 'MyArray'
....

Currently code not generated with this spec

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 the Swift 5 code-generation path and reproduce the issue using the supplied YAML schema with an array-valued oneOf entry. Compare the generated output with the requested typeArray([MyArray]) case; done means this schema generates valid Swift code for the array variant without breaking other oneOf variants.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, swift
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.