sagold / json-schema-library

Customizable and hackable json-validator and json-schema utilities for traversal, data generation and validation
MIT License
175 stars 18 forks source link

Add configuration option to add optional properties in getTemplate #14

Closed benurb closed 3 years ago

benurb commented 3 years ago

Hello,

in our use case it would be great if json-schema-library would not add optional properties to templates. This way we end up with a lot { some: 0, any: "", ...} properties. These are unnecessary. So I added an option to getTemplate() that prevents this, but leaves the current behaviour in place as default.

Best Regards, Ben

sagold commented 3 years ago

Looks great. I'd prefer type over interface and maybe a test or two. Will merge it anyways.

sagold commented 3 years ago

pr has been released with v5.3.0