Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #10282
Closed
Open
Issue created Aug 29, 2021 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

[feature-enhancement-request] models.one_ofintegernumber for python-flask

Created by: maliky

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

Why do I have the error ModuleNotFoundError: No module named 'openapi_server.models.one_ofintegernumber'

when running the python-flask generated stub ? I was expecting it to lauch a http server like it does for the petstore exemple.

openapi-generator version

I'm using the version 5.3.0-SNAPSHOT (after trying with latest stable)

OpenAPI declaration file content or url

I use the yaml from https://docs.kraken.com/rest/ that I validated with https://apidevtools.org/swagger-parser/online/

https://gist.github.com/maliky/03de5e2a1664ec8df5a665c517d0d151

Generation Details

I cloned the git repertory, compiled to use the latest and ran

java -jar openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -g python-flask -i swagger-kraken-validated.json -o Og-latest-kraken -p legacyDiscriminatorBehavior=false 

then in a virtualenv with the requirements installed I run

python -m openapi_server

Full traceback

Traceback (most recent call last):
  File "/home/mlk/.pyenv/versions/3.8.2/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/mlk/.pyenv/versions/3.8.2/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/mlk/Prog/Python/Crypto/API/Swagger-OpenAPI/Og-latest-kraken/openapi_server/__main__.py", line 5, in <module>
    from openapi_server import encoder
  File "/home/mlk/Prog/Python/Crypto/API/Swagger-OpenAPI/Og-latest-kraken/openapi_server/encoder.py", line 4, in <module>
    from openapi_server.models.base_model_ import Model
  File "/home/mlk/Prog/Python/Crypto/API/Swagger-OpenAPI/Og-latest-kraken/openapi_server/models/__init__.py", line 8, in <module>
    from openapi_server.models.asset_pair import AssetPair
  File "/home/mlk/Prog/Python/Crypto/API/Swagger-OpenAPI/Og-latest-kraken/openapi_server/models/asset_pair.py", line 9, in <module>
    from openapi_server.models.one_ofintegernumber import OneOfintegernumber
ModuleNotFoundError: No module named 'openapi_server.models.one_ofintegernumber'
Steps to reproduce

Try to generate server python-flask stub from the given json file.

Related issues/PRs

Did not find any

Suggest a fix

Looks like some typing hint not working as expected ?

Assignee
Assign to
Time tracking