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
  • #11518
Closed
Open
Issue created Feb 04, 2022 by Administrator@rootContributor

[BUG] [python-experimental] Type null not handled properly in toExampleValue

Created by: MalteEbner

Description

With the following configuration, the openapi-generator with python-experimental breaks

  • openapi-generator-cli 5.4.0, installed via npm
  • using python-experimental
  • using the OAI/OpenAPI-Specification/main/examples/v2.0/yaml/petstore.yaml

Switching to python (non-experimental) or other specs solved the problem.

openapi-generator version

5.4.0

Steps to reproduce

Google colab for reproduction: https://colab.research.google.com/drive/1z2KnELth4HfaK-36ntjr_7v9g65QF63W?usp=sharing

Fully self-contained substeps in Google colab:

# install openapi-generator-cli
!npm install -g @openapitools/openapi-generator-cli
!openapi-generator-cli version-manager set 5.4.0

# get the PetStore.yaml and generate it:
!wget https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/examples/v2.0/yaml/petstore.yaml
!ls
!openapi-generator-cli generate -i petstore.yaml -g python-experimental

# Error:
# first some
[main] WARN  o.o.c.l.AbstractPythonCodegen - Type null not handled properly in toExampleValue
# then finally a
java.lang.NullPointerException
Related issues/PRs
  • https://github.com/OpenAPITools/openapi-generator/issues/10143
  • https://github.com/OpenAPITools/openapi-generator/issues/8663 shows exactly the same error
  • https://github.com/OpenAPITools/openapi-generator/issues/7824
  • https://github.com/OpenAPITools/openapi-generator/pull/9131 fixed it in the python branch
Suggest a fix
  • fix it in the generator
Assignee
Assign to
Time tracking