Skip to content

Comments

Handle object with missing properties in JSON schema#434

Merged
adrianisk merged 1 commit intomainfrom
adriank/object_missing_properties
Jun 17, 2025
Merged

Handle object with missing properties in JSON schema#434
adrianisk merged 1 commit intomainfrom
adriank/object_missing_properties

Conversation

@adrianisk
Copy link
Contributor

@adrianisk adrianisk commented Jun 17, 2025

Summary

Small change to the JSONSchemaConverter to handle objects with no "properties" keyword, which is technically valid

{
    "type": "object"
}

The output is the same as an object with "properties": {} - a StructType with an empty fields array

Copy link
Contributor

@mjperrone mjperrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May also want to bump the package version and add a note to the changelog in this PR if not in a following one.

return self._parse(json_schema, alias_strategy)
types = [self._parse(s, alias_strategy) for s in type_list]
return UnionType(types, **extra_attrs)
case {"type": "object", "properties": properties}:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL about match case binding - cool

@adrianisk
Copy link
Contributor Author

May also want to bump the package version and add a note to the changelog in this PR if not in a following one

The patch version gets bumped automatically as part of the publishing workflow so we're already good to go (cd99f87)

@adrianisk adrianisk force-pushed the adriank/object_missing_properties branch from 6e539b9 to e7436fc Compare June 17, 2025 19:21
adrianisk added a commit that referenced this pull request Jun 17, 2025
# Summary

Temporarily pins the `confluentinc` images in the integration test
docker-compose file. Confluent recently [released version 8 of their
images](https://hub.docker.com/r/confluentinc/cp-schema-registry/tags?ordering=name&name=8.0)
which fail to start using the current config. Pinning to the latest 7.*
version to unblock tests

I'll rebase #434 once this is in

Co-authored-by: Adrian Kreuziger <adrian@gable.ai>
@adrianisk adrianisk force-pushed the adriank/object_missing_properties branch from e7436fc to e10f6b7 Compare June 17, 2025 20:29
@adrianisk adrianisk merged commit 3d8b50e into main Jun 17, 2025
6 checks passed
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.

2 participants