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

appsettings.json with array not being transformed correctly. #46

Open
JR33D opened this issue Aug 4, 2023 · 0 comments
Open

appsettings.json with array not being transformed correctly. #46

JR33D opened this issue Aug 4, 2023 · 0 comments

Comments

@JR33D
Copy link

JR33D commented Aug 4, 2023

I have an issue where I'm using your task to read my appsettings.{env}.json transform file as part of a yaml pipeline, I can see the settings get loaded into the variables, but then it isn't applying to the end file for arrays. Everything else seems to work as expected.
appsettings.{env}.json

  "SQS": {
    "RunWindows": [
      {
        "Start": "04:00:00",
        "End": "21:30:00",
        "TimeZone": "UTC"
      }
    ]
  },

appsettings.json

"SQS": {
  "RunWindows": [
    {
      "Start": "10:00:00",
      "End": "20:00:00",
      "TimeZone": "UTC"
    }
  ]
}

I can see the output in the pipeline is coming out as SQS.RunWindows1.Start, SQS.RunWindows1.End, SQS.RunWindows1.TimeZone
I believe this should be SQS.RunWindows.1.Start, SQS.RunWindows.1.End, sqs.runwindows.1.TimeZone based on the
JSON variable substitution notes on Microsoft's FileTransform.

Am I misunderstanding something here or has this issue just not come up?

I believe the issue is in this line of code and the fix would be just to add the period before adding the number
prfx = thisDataItem.PrefixChain + (arrayNDX + 1).toString();

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

No branches or pull requests

1 participant