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

Fix empty interfaces for multi patternProperties

Open ggoodman opened this issue 4 years ago • 1 comments

When a schema declared multiple patternProperties and no additionalProperties, the resulting type definition was effectively 'empty'.

This PR produces something that makes a bit more intuitive sense to me for when a schema has no additionalProperties and patternProperties.

ggoodman avatar May 22 '20 20:05 ggoodman

I believe this addition would make it more complete. As an example, try compiling the OpenAPI3 json schema spec into TypeScript definitions. In order to make it usable I need to extend the Paths interface since its empty by default using this tool. Ideally you would like it to function out-of-the-box. However, I'm not sure whether the behavior of this PR is correct since I get an Unknown (with capital) when compiling the OpenAPI. It might need some more fine tuning

sebas2day avatar Jul 07 '20 10:07 sebas2day