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
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:
To provide a deref function to the template engine, and just give the openapi.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),
To resolve the full OpenAPI data before rendering the templates. Harder, and infinite recursion issues.
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!
The text was updated successfully, but these errors were encountered:
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!
The text was updated successfully, but these errors were encountered: