Skip to content
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

Render templates using env before dereferencing #124

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RemiBardon
Copy link
Member

@RemiBardon RemiBardon commented Jun 22, 2024

Allows using ${{ env.anything }} in $refs.

See stepci/stepci#220 for a use case explanation.

stepci/liquidless#12 needs to be merged before. Then I'll update liquidless and make sure my code works (I didn't check yet as I can't do it easily). Edit: See #124 (comment)

Allows using `${{ env.anything }}` in `$ref`s.

See stepci/stepci#220 for a use case explanation.
@RemiBardon RemiBardon force-pushed the render-env-before-dereferencing branch from b868250 to 8e46f3d Compare June 23, 2024 06:10
@RemiBardon RemiBardon marked this pull request as ready for review June 23, 2024 06:10
@RemiBardon
Copy link
Member Author

@mishushakov I implemented it without needing stepci/liquidless#12, with the solution I explained in stepci/liquidless#12 (comment).

@RemiBardon
Copy link
Member Author

Even though tests are not processed in any way, I still added test cases to manually check that my implementation works (and it does).

@RemiBardon
Copy link
Member Author

RemiBardon commented Aug 26, 2024

About stepci/liquidless#12, we could use json-schema-ref-parser's onDereference option. I didn't know if this option existed or not, well it does!

Edit: It doesn't work… because onDereference runs AFTER dereferencing and not DURING dereferencing, therefore an error is thrown before we even get the chance to mutate the path. And excludedPathMatcher doesn't help either, as it's not called either from what I tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant