-
Notifications
You must be signed in to change notification settings - Fork 33
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
Stack overflow by $ref in targetSchema #29
Comments
It's a know bug that waits for a good solution. |
So I think it'd be really useful to fix this. This bug seems to come from a few places...
As an example of a self-referential type, consider this example. I think this would be impossible to represent in Go without first naming the type, right? In general, I would think that it would be useful to use a 3rd party package that has excellent support for JSON Schema and outsource the responsibilities of parsing and representation there. Right now there is such a package, github.com/xeipuuv/gojsonschema, but the package does not expose its internals yet. I've created a bug over there that highlights a potential approach to exposing the parsed schema: I think that visitor design has to account for cyclic types in some way such that this package could stop recursing. The remaining set of responsibilities in this package would be to move to outputting NAMED types, at least where they required (such as the case of cycles, including types that are mutually recursive). This would be a fairly major change, overall. I'd want to know that the general direction would be acceptable to both parties before embarking on such an adventure. @cyberdelia @brandur would you be interested in seeing such a change? How much support is coming from Heroku on this project? |
Yes.
Unfortunately, I have little time to try to tackle this, but would welcome something in that direction. |
@shutej Great summary of the situation. Thanks!
I'd personally love to see this change. As mentioned in the other thread though, the way we're currently organized internally is leading to a poor maintenance story for our client software like Schematic. I think there's a possibility this could change in the next few months, but at the moment we don't have that many resources to throw at this problem. Also CC @geemus for general interest on this one. |
Yeah, would definitely support fixes, but lack bandwidth internally to be able to move it forward currently. |
@geemus @cyberdelia I've taken a stab at this over in #39. Feedback welcomed. |
In this example, save the following JSON Schema as
infinite.json
.When run the
schematic infinite.json
then it will panic by stack overflow as follows.The text was updated successfully, but these errors were encountered: