-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FromSchema type instantiation limit #204
Comments
i tried to separate the large one into smaller ones, specifically dividing the |
after a bit of experiments I came to a kind of a solution for a really large schemas with lots of references like this one: JSON
- split references to a different schemas, use but for some reason, after N-th reference is passed to
and with that case it works. however this workaround is kind of ugly, and I'd like to say that FromSchema is having difficulties with large schemas (up to 950 LOC) that are in turn reference lots of other schemas (in my case its 11 schemas like entitySchema, each up to 250 LOC). If @ThomasAribart could provide a more elegant solution to this, that would be awesome! |
Good day! @ThomasAribart thank you for your work, really pushes the limits of what could be done using TS types system and big thanks to @xblurx for research and sharing the knowledge. In my project I also have schema of size about 3k lines and dozens of local definitions and references. And it seems like I also hit the limit of library capabilities or/and typescript limitations. Schema is more or less the same as above, TS version is 5.5, tsconfig contains all the requirements from instructions, no recursive definitions. However, I do have I was trying to expand memory limit for TS or find out some kind of other workarounds, but still there is a unstable (in terms of exact number) but frustrating limit for @xblurx 's tweaks helped in some way, but not really... So it seems, that we need some kind of systemic solution for inferring type from large schemas with local definitions... Thank you again, this library is really helpful! |
Hi and thank you for this amazing library.
I have a question regarding the current limit of FromSchema where T is very wide. This is an example of schema for T that errors with
Type instantiation is excessively deep and possibly infinite.ts(2589)
:Example JsonSchema
i read the FAQ regarding this issue and I can say that there are none
allOff
,not
,else
,ifThenElse
keywords used.maybe you could suggest a temporary workaround, or is this simply a typescript + json-schema-to-ts limitation and it was not designed for dealing with huge schemas such as this one?
Appreciate it!
The text was updated successfully, but these errors were encountered: