happytal / substitute-variables

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

File transfor issue in YAML if there is a "-" in key #20

Closed ajaypelluri555 closed 10 months ago

ajaypelluri555 commented 10 months ago

this was not working datasource: database-secret-key: common-db-key

Please provide the fix or provide me the code chage.If possible

fhervieux commented 10 months ago

Hi!

The substitution names are evaluated using JSONPath so my guess is that you are using an invalid syntax for variable substitution datasource.database-secret-key. When you have special characters you can use this syntax instead: datasource["database-secret-key"].

Can you try with this syntax if it fixes your issue?

ajaypelluri555 commented 10 months ago

Sure I will try and let you know. Thank you.

On Fri, 8 Dec 2023 at 2:35 PM, François Hervieux @.***> wrote:

Hi!

The substitution names are evaluated using JSONPath so my guess is that you are using an invalid syntax for variable substitution datasource.database-secret-key. When you have special characters you can use this syntax instead: datasource["database-secret-key"].

Can you try with this syntax if it fixes your issue?

— Reply to this email directly, view it on GitHub https://github.com/happytal/substitute-variables/issues/20#issuecomment-1846805232, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4TKNG54SNOQGEOOTK2FMDYILJ5JAVCNFSM6AAAAABAMH5JOWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBWHAYDKMRTGI . You are receiving this because you authored the thread.Message ID: @.***>

ajaypelluri555 commented 10 months ago

I tryed this syntax spring.datasource["database-secret-key"] syntax it working fine.I updated in azure variable group spring.datasource["database-secret-key"] insted of spring.datasource.database-secret-key FYI. image thank you.

fhervieux commented 10 months ago

Great!