Skip to content

Make some models require all keys in their underlying dictionaries#5657

Open
quis wants to merge 10 commits intomainfrom
strict-json-model
Open

Make some models require all keys in their underlying dictionaries#5657
quis wants to merge 10 commits intomainfrom
strict-json-model

Conversation

@quis
Copy link
Copy Markdown
Member

@quis quis commented Nov 7, 2025

This will raise an error if one of the attributes is missing from the dictionary.

This is the same way that the serialised models work in the API.

This gives us more confidence that the mock data in the tests is realistic.

This pull request only does this for the less complicated models. More complicated ones can receive data from different sources and may not be always be initialised with data that has the same schema.

@quis quis force-pushed the strict-json-model branch from fbd2bde to 256ff93 Compare November 7, 2025 16:40
@quis quis force-pushed the strict-json-model branch from 256ff93 to 1e7ff29 Compare February 4, 2026 15:06
@quis quis marked this pull request as ready for review February 4, 2026 15:08
@quis quis force-pushed the strict-json-model branch 2 times, most recently from 47e14d9 to 5c05bbe Compare February 10, 2026 16:43
@quis quis force-pushed the strict-json-model branch from 5c05bbe to 08aa3b3 Compare February 10, 2026 17:05
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.

1 participant