Skip to content

fix: preserve value schema for dict-of-dicts type keys in json_schema#346

Open
SAY-5 wants to merge 1 commit into
keleshev:masterfrom
SAY-5:fix-json-schema-dict-of-dicts
Open

fix: preserve value schema for dict-of-dicts type keys in json_schema#346
SAY-5 wants to merge 1 commit into
keleshev:masterfrom
SAY-5:fix-json-schema-dict-of-dicts

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 24, 2026

Copy link
Copy Markdown

Fixes #329.

Schema.json_schema() dropped the value schema when a dict used a type key (str/object) mapping to a sub-schema. For {str: {"property-1": str}} it emitted additionalProperties: true and lost the nested schema entirely.

Now the value schema is rendered into additionalProperties, matching the expected output in the issue. Scalar cases like {str: str} and {object: int} still emit true as before, so existing tests are unchanged. Added a regression test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Schema.json_schema() does not return properties for a dict of dicts where first level key can be any string

1 participant