dc_schema icon indicating copy to clipboard operation
dc_schema copied to clipboard

adding additionalProperties=False to the classes schema

Open martinResearch opened this issue 1 year ago • 1 comments

Thank you for this library. It is very nice to have a no-invasive solution that does not require to use a new dataclass or decorators. At the moment the exported schema do not forbid the addition of fields in the json that are not in the corresponding dataclass, which limit the capability to detect spelling errors for optional fields. It would be great to add additionalProperties=False when creating the schema for the dataclasses to make the schema more strict. I can submit a PR if that can help.

martinResearch avatar Nov 25 '24 09:11 martinResearch

@martinResearch do you already have a solution in place? This feature would be valuable for me as well.

larsmaxfield avatar Dec 22 '24 16:12 larsmaxfield