Openapi-generator: [BUG] python-flask: oneOf model class doesn't generate though imported

Created on 1 Feb 2020  路  4Comments  路  Source: OpenAPITools/openapi-generator

Bug Report Checklist

  • [ ] Have you provided a full/minimal spec to reproduce the issue?
  • [ ] Have you validated the input using an OpenAPI validator (example)?
  • [ ] What's the version of OpenAPI Generator used?
  • [ ] Have you search for related issues/PRs?
  • [ ] What's the actual output vs expected output?
  • [ ] [Optional] Bounty to sponsor the fix (example)
Description
openapi-generator version
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix
Bug

Most helpful comment

I am facing the same. In one of my models:

from openapi_server.models.one_ofstringnumberboolean import OneOfstringnumberboolean # noqa: E501

however this file doesn't exist:
from openapi_server.models.one_ofstringnumberboolean import OneOfstringnumberboolean ModuleNotFoundError: No module named 'openapi_server.models.one_ofstringnumberboolean'

the component yaml looks as follows:

    pair:
      type: object
      properties:
        proba:
          type: number
        label:
          oneOf:
          - type: string
          - type: number
          - type: boolean
      required:
        - proba
        - label

All 4 comments

I am facing the same. In one of my models:

from openapi_server.models.one_ofstringnumberboolean import OneOfstringnumberboolean # noqa: E501

however this file doesn't exist:
from openapi_server.models.one_ofstringnumberboolean import OneOfstringnumberboolean ModuleNotFoundError: No module named 'openapi_server.models.one_ofstringnumberboolean'

the component yaml looks as follows:

    pair:
      type: object
      properties:
        proba:
          type: number
        label:
          oneOf:
          - type: string
          - type: number
          - type: boolean
      required:
        - proba
        - label

I am having the same issue when I tried to generate the code using the following OpenAPI spec: https://raw.githubusercontent.com/bacen/pix-api-recebimentos/master/openapi.yaml

The command to generate was:

openapi-generator generate -i ../openapi.yaml -g python-flask -o . -s --package-name mock

I also tried with the --legacy-discriminator-behavior flag but still not generating the module.

+1
Having the same issue

Was this page helpful?
0 / 5 - 0 ratings