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

Failed to handle complex arrays containing nested objects #209

Open
oolubodun opened this issue Aug 14, 2024 · 0 comments
Open

Failed to handle complex arrays containing nested objects #209

oolubodun opened this issue Aug 14, 2024 · 0 comments

Comments

@oolubodun
Copy link

oolubodun commented Aug 14, 2024

Hi there,

I have been successfully using this agent task for replacing tokens in my appsettings.json files. However, it's failing when I try using a template with nested objects.

Environment: Azure DevOps

Steps to reproduce:
Source Content
"AzureSettings": { "BlobServiceUrl": "your-connection-string", "ResourceGroupName": "your-storage-account-resource-group-name", "ResourceId": "your-client-id", "SubscriptionId": "your-subscription-id", "TenantId": "your-tenant-id", "StorageAccounts": [ { "Name": "your-storage-account-name", "StorageContainers": [ { "Name": "your-storage-container-name", "OutputPath": "your-storage-container-output-path", "Path": "your-storage-container-path", "SubFolder": "your-storage-container-path-subfolder", "SupportedDocTypes": [ { "FileExtension": "file-extension", "Path": "storage-container-path-for-supported-doc-type" } ] } ] } ] }

Generated Output:
"AzureSettings": { "BlobServiceUrl": "__AzureSettings.BlobServiceUrl__", "ResourceGroupName": "__AzureSettings.ResourceGroupName__", "ResourceId": "__AzureSettings.ResourceId__", "SubscriptionId": "__AzureSettings.SubscriptionId__", "TenantId": "__AzureSettings.TenantId__", "StorageAccounts": [ { "Name": "__AzureSettings.StorageAccounts[0].Name__", "StorageContainers": [ { "Name": "__AzureSettings.StorageAccounts[0].Name__", "Path": "your-storage-container-path", "SubFolder": "your-storage-container-path-subfolder", "OutputPath": "your-storage-container-output-path", "SupportedDocTypes": [ { "FileExtension": "file-extension", "Path": "storage-container-path-for-supported-doc-type" } ] } ] } ] }

Expected Output:
"AzureSettings": { "BlobServiceUrl": "__AzureSettings.BlobServiceUrl__", "ResourceGroupName": "__AzureSettings.ResourceGroupName__", "ResourceId": "__AzureSettings.ResourceId__", "SubscriptionId": "__AzureSettings.SubscriptionId__", "TenantId": "__AzureSettings.TenantId__", "StorageAccounts": [ { "Name": "__AzureSettings.StorageAccounts[0].Name__", "StorageContainers": [ { "Name": "__AzureSettings.StorageAccounts[0].StorageContainers[0].Name__", "OutputPath": "__AzureSettings.StorageAccounts[0].StorageContainers[0].OutputPath__", "Path": "__AzureSettings.StorageAccounts[0].StorageContainers[0].Path__", "SubFolder": "__AzureSettings.StorageAccounts[0].StorageContainers[0].SubFolder__", "SupportedDocTypes": [ { "FileExtension": "__AzureSettings.StorageAccounts[0].StorageContainers[0].SupportedDocTypes[0].FileExtension__", "Path": "__AzureSettings.StorageAccounts[0].StorageContainers[0].SupportedDocTypes[0].Path__" }, ... ] } ] } ] }

As you can see, only a partial transformation has occurred. Nested object properties (e.g., Path, SubFolder, etc. under StorageContainers and FileExtension, Path under SupportedDocTypes) are being ignored.

Please let me know if you need any further information to investigate this issue.

Kind regards,
Olu...

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