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

add defaultAdditionalProperties option

Open Karel-Kroeze opened this issue 4 years ago • 0 comments

Exposes the default value for additionalProperties on an object type as an option, implementing a repeatedly requested feature (#335, #346, #358).

I've added the option to the appropriate interface, the CLI help message and the readme. Implementation was simple, as the normalization step already sets a default value.

I was unable to run the tests (npm run tdd crashes with OOM errors). I did confirm that it properly generates much more restrictive interfaces (without [k: string]: unknown;).

This is my first contribution, so please let me know if there's anything I've missed or done wrong.

Karel-Kroeze avatar Apr 20 '21 22:04 Karel-Kroeze