dbt-labs / hologram

A library for automatically generating Draft 7 JSON Schemas from Python dataclasses
MIT License
9 stars 13 forks source link

add support for inheritance, deserializing data into its class without knowing which class it is beforehand #9

Closed cmcarthur closed 5 years ago

cmcarthur commented 5 years ago

this doesn't fix the kwargs before positional args problem, but it makes inheritance a little easier. namely:

note that the second breaks everything if you have a JSON schema with additionalProperties: true and all defaults. if you have that registered, every call to JsonSchemaMixin.from_dict will return you that thing

we should probably set additionalProperties: false by default to address this

beckjake commented 5 years ago

we should probably set additionalProperties: false by default to address this

+1 on this... +1000 really

cmcarthur commented 5 years ago

@beckjake I actually think I should add those back in, because I think I broke all_json_schemas. what do you think about adding additionalProperties: false to all of our JSON schemas by default?

cmcarthur commented 5 years ago

@beckjake ready for another look