Skip to content

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

@MalteEbner

Description

@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
Suggest a fix
  • fix it in the generator

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions