swagger-api / swagger-api/swagger-codegen

Python-flask server stub generation fails using anyOf

Open
#9,882 3 comments 0 reactions 1 assignee View on GitHub

@HugoMario is already working on this.

Since May 8, 2020.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Example on a requestbody:

                    items: 
                      anyOf:
                        - $ref: '#/components/schemas/FingerPosition'
                        - $ref: '#/components/schemas/CameraPose'

this fails on python-flask (not on other server stubs) with the following error:

Error.There was an error generating the servers python-flask code. Please ensure that the definition and all external refs (inc. domains) are valid.

replacing with, for example:

                    items: 
                      type: string

works

Swagger-codegen version

Swagger Codegen to v. 2.4.9 for OpenAPI 2.0 and 3.0.13 for OpenAPI 3.0.

Swagger declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.