Skip to content

[BUG][PYTHON] ComposedSchema - Type null not handled properly in toExampleValue  #10143

@rtician

Description

@rtician

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

PythonClientCodegen when run against openapi.yaml will produce the followin warning output.

[main] WARN  o.o.c.l.AbstractPythonCodegen - Type null not handled properly in toExampleValue
openapi-generator version

5.2.1

OpenAPI declaration file content or url
openapi: 3.0.0
info:
  title: API
  version: 1.0.0
paths:
  /pet:
    get:
      operationId: get_handler
      parameters:
      - in: query
        name: pet
        schema:
          $ref: '#/components/schemas/Dog'
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
          description: Success
components:
  schemas:
    Pet:
      type: object
      properties:
        pet_type:
          type: string
    Dog:
      allOf:
        - $ref: '#/components/schemas/Pet'
        - type: object
          properties:
            bark:
              type: boolean
Generation Details
openapi-generator generate -i openapi.yaml -g python-flask -t templates --package-name 
Steps to reproduce

Generate the client using the command above

Related issues/PRs

No similar PR

Suggest a fix

Handle the ComposedSchema example generation in AbstractPythonCodegen -> toExampleValueRecursive.

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