json-schema-library icon indicating copy to clipboard operation
json-schema-library copied to clipboard

Remove additional properties

Open dodas opened this issue 1 year ago • 1 comments

Is there a way to remove additional properties from objects, similar to ajv's removeAdditional?

dodas avatar Jan 31 '24 17:01 dodas

Hi Jozef,

there is an option to remove invalid data in getTemplate https://github.com/sagold/json-schema-library/blob/main/lib/getTemplate.ts#L19. So you can pass in your current data run getTemplate with it, resulting in data that conforms to the json-schema. Would this help your case?

Cheers, Sascha

sagold avatar Feb 25 '24 09:02 sagold