Closed FosterSamuel closed 3 months ago
hey @FosterSamuel
thanks for raising this issue and fixing it. I quickly looked over the changes, they are looking good. Feel free to create a PR. It will probably be merged and released in the next couple of days
Thanks @xddq! Opened #51 .
Library version: 1.7.4
JSON schema version: draft-07
I am willing to contribute to fix the issue 💚
The current behavior
When parsing schemas with
Any
orUnknown
, an error is thrown. Example:The expected behavior
Parse
innerAny
andinnerUnknown
asType.Unknown
.Maybe this was intentionally avoided? I couldn't find anything in my search of the repo discussing this.
Why does it happen? What/How to fix the issue?
Empty
{}
is not parsed. Branch with fix: https://github.com/FosterSamuel/schema2typebox/commit/0af202fcabf6c2b96fdee3adb63914268a84e41bContent of minimal json schema file which causes the problem
Click to expand/collapse
```json { "title": "Example", "type": "object", "properties": { "innerAny": {}, "innerUnknown": {}, }, "required": ["innerAny", "innerUnknown"] } ```