happytal / substitute-variables

Azure DevOps task for substituting variables in plain JSON and YAML files
MIT License
1 stars 0 forks source link

Transform not working if contains "-" in parent key of yaml file #21

Closed ajaypelluri555 closed 10 months ago

ajaypelluri555 commented 10 months ago

the below code contains the special char in key which is main parent we tryed to trand form ["enable-aws-secrets"] but It was not working. this syntax will works if the key is chaild

enable aws secretes manager(include redis, database, email, cognito key)

enable-aws-secrets: true --------> ["enable-aws-secrets"] Not Working

datasource: database-secret-key: common-db-key -------> spring.datasource["database-secret-key"] Working file

please let me know the fix.

thank you.

fhervieux commented 10 months ago

Hi! Since the task uses JSON Path you should be able to use "$" as root so a syntax like this could work:

$["database-secret-key"]
ajaypelluri555 commented 10 months ago

Thank you Its working fine now.