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

fix(core): properties as map is now working properly with expression within base maps #6800

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

Conversation

brian-mulier-p
Copy link
Member

No description provided.

try {
property.value = MAPPER.readValue(rendered, type);
if (property.expression.startsWith("{{")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An expression can be "in the middle" so it would be better to check if it contains {{ and }}.
We should have an helper for that as I think it's already done somewhere else

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I'm not sure I understand why you did this...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because there's two cases for which you would want to render as map (obviously when the target property type is a map):

  • the property itself is an expression ({{outputs.task.myMap}})
  • the property is filled with a yaml map (which can itself contain expression for each value that's why checking for "contains {{" is not enough

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should at least check for start and end.
And please add a comment as it's not trivial to understand reading the code

@brian-mulier-p brian-mulier-p force-pushed the fix/property-as-map-with-nested-expressions branch from ee648c6 to dd04042 Compare January 17, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To review
Development

Successfully merging this pull request may close these issues.

2 participants