Open truchi opened 11 months ago
We don't have this concept of pointers in the data in either Tera v1 or v2. No plans to add any hook in there either
Noted. Thanks.
Note: it's not even possible to implement deref
since pub fn register_function<F: Fn(...) -> ... + 'static>
.
Hello,
I'm prototyping an OpenAPI generator with Tera (great job btw).
I am facing this issue: in OpenAPI, objects can reference other objects. To deal with this I have the option:
deref
function to the template engine, and just give theopenapi.yaml
entry as the context. Simple, but has the drawback that the template is not agnostic from the input (deref
calls in the templates must be updated after using/unusing$ref
in the yaml),It would be ideal to have the chance to "hook" variable resolution (is that how you call it?) so dereferencing could happen automagically in the templates.
Is that something that I can do with Tera currently? Or how could I emulate it? Do you have broader ideas on how to tackle this issue?
Thank you!