You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1437 removed the ability to use recursive types. We used these in protoc-gen-gorm to created nested query structures. We parse SQL where clauses into an AST tree ie. WHERE group=acme AND tag=recent. The issue is that this syntax can have multiple layers of logical operators (AND OR).
WHERE (group='acme' AND tag = 'recent') or tag = 'override')
Now that nested query parameters are specifically rejected, we are unable to parse these nested structures. I would like to be able to have recursive types to build trees. Here's an example proto definition. One of the possible parameters of LogicalOperator is LogicalOperator. As openapiv2 plugin inspects this, it returns the error: panic: recursive types are not allowed for query parameters, cycle found on ".infoblox.api.LogicalOperator"
Hi Drew, thanks for the issue. It seems to me the original block on recursive types in query parameters was because it was causing an infinite loop in the parsing (#1167). I'd be happy to reintroduce recursive types as long as we have a plan to deal with that issue, which may mean detecting loops and short circuiting some recursion instead of outright disallowing the messages.
I think there's plenty of prior art here to study, but if you're unsure where to start, #1266 and #1437 are probably good places.
I agree on the infinite loop piece. I think starting with type detection made sense. We just need add counters to them. If type encountered 1000 times, panic.
🚀 Feature
#1437 removed the ability to use recursive types. We used these in protoc-gen-gorm to created nested query structures. We parse SQL where clauses into an AST tree ie.
WHERE group=acme AND tag=recent
. The issue is that this syntax can have multiple layers of logical operators (AND OR).Now that nested query parameters are specifically rejected, we are unable to parse these nested structures. I would like to be able to have recursive types to build trees. Here's an example proto definition. One of the possible parameters of LogicalOperator is LogicalOperator. As openapiv2 plugin inspects this, it returns the error:
panic: recursive types are not allowed for query parameters, cycle found on ".infoblox.api.LogicalOperator"
https://github.com/infobloxopen/atlas-app-toolkit/blob/master/query/collection_operators.proto#L83
The text was updated successfully, but these errors were encountered: