j-d-carmichael / boats

Beautiful Open Api Template System
MIT License
57 stars 8 forks source link

nunjuck include not possible when using tpl from outside of project #17

Closed Acrontum-Carmichael closed 2 years ago

Acrontum-Carmichael commented 4 years ago

https://mozilla.github.io/nunjucks/templating.html#include

./src/components/jwt/access/model.yml.njk

Try to include this component from another project but it will throw an error.

{% include "../../../../ms-authentication/src/components/jwt/access/model.yml.njk" %}

It is possible to use the $ref from openapi/asyncapi - but this means juggling with other features eg allOf or nesting in another attribute. Would be cleaner to be able to just pull the code in.

p-mcgowan commented 4 years ago

might be able to extractthe code from the template path resolver and reuse it here - it probably just need to be converted to absolute path, since it ends up as-is in the build folder