Skip to content

[BUG][PYTHON] 3.1 property with additionalProperties without type isn't deserialized #25054

Open

Description

@brettkail-wk
Description

With the python generator, an openapi: 3.1.0 schema with a property that has additionalProperties but no type: object serializes correctly but is ignored during deserialization. The same schema works for other 3.1 generators (e.g., java, typescript-fetch) and for the python generator when using openapi: 3.0.0.

As a workaround, explicit type: object fixes the issue.

openapi-generator version

7.25.0

OpenAPI declaration file content or url
openapi: 3.1.0

info:
  version: 1.0.0
  title: 'Example'

paths: {}

components:
  schemas:
    Example:
      properties:
        map:
          #type: object
          additionalProperties:
            type: string
Generation Details
java -jar openapi-generator-cli-7.25.0.jar generate -i example.yaml -o example -g python
Steps to reproduce

Run generator, and observe the from_dict excludes the field. After installing requirements.txt:

$ python -c 'from openapi_client.models.example import Example; print(Example(map={"k": "v"}).to_json())'
{"map": {"k": "v"}}
$ python -c 'from openapi_client.models.example import Example; print(Example.from_json("{\"map\": {\"k\": \"v\"}}"))'
map=None
Related issues/PRs
Suggest a fix

I see that updateParameterForMap sets isMap = true, but updatePropertyForMap doesn't.

Activity

  1. added a commit that references this issue on Oct 1, 2026
    5f350e1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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