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

Change dictionary key structure #6

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ resource symbolicname 'Microsoft.Compute/disks@2024-03-02' = {
name: 'string'
}
tags: {
{customized property}: 'string'
'[key (string)]': 'string'
}
zones: [
'string'
Expand Down Expand Up @@ -426,7 +426,7 @@ To create a Microsoft.Compute/disks resource, add the following JSON to your tem
"name": "string"
},
"tags": {
"{customized property}": "string"
"[key (string)]": "string"
},
"zones": [ "string" ]
}
Expand Down Expand Up @@ -715,7 +715,7 @@ resource "azapi_resource" "symbolicname" {
name = "string"
}
tags = {
{customized property} = "string"
"[key (string)]" = "string"
}
zones = [
"string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource symbolicname 'Microsoft.CostManagement/exports@2019-01-01' = {
definition: {
dataset: {
aggregation: {
{customized property}: {
'[key (string)]': {
function: 'string'
name: 'string'
}
Expand Down Expand Up @@ -274,7 +274,7 @@ To create a Microsoft.CostManagement/exports resource, add the following JSON to
"definition": {
"dataset": {
"aggregation": {
"{customized property}": {
"[key (string)]": {
"function": "string",
"name": "string"
}
Expand Down Expand Up @@ -493,7 +493,7 @@ resource "azapi_resource" "symbolicname" {
definition = {
dataset = {
aggregation = {
{customized property} = {
"[key (string)]" = {
function = "string"
name = "string"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ resource symbolicname 'Microsoft.DocumentDB/databaseAccounts@2024-05-15' = {
identity: {
type: 'string'
userAssignedIdentities: {
{customized property}: {}
'[key (string)]': {}
}
}
kind: 'string'
Expand Down Expand Up @@ -183,7 +183,7 @@ resource symbolicname 'Microsoft.DocumentDB/databaseAccounts@2024-05-15' = {
]
}
tags: {
{customized property}: 'string'
'[key (string)]': 'string'
}
}
```
Expand Down Expand Up @@ -475,7 +475,7 @@ To create a Microsoft.DocumentDB/databaseAccounts resource, add the following JS
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": {
"[key (string)]": {
}
}
},
Expand Down Expand Up @@ -577,7 +577,7 @@ To create a Microsoft.DocumentDB/databaseAccounts resource, add the following JS
]
},
"tags": {
"{customized property}": "string"
"[key (string)]": "string"
}
}
```
Expand Down Expand Up @@ -872,7 +872,7 @@ resource "azapi_resource" "symbolicname" {
identity = {
type = "string"
userAssignedIdentities = {
{customized property} = {
"[key (string)]" = {
}
}
}
Expand Down Expand Up @@ -984,7 +984,7 @@ resource "azapi_resource" "symbolicname" {
}
})
tags = {
{customized property} = "string"
"[key (string)]" = "string"
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ resource symbolicname 'Microsoft.KeyVault/vaults@2023-07-01' = {
vaultUri: 'string'
}
tags: {
{customized property}: 'string'
'[key (string)]': 'string'
}
}
```
Expand Down Expand Up @@ -306,7 +306,7 @@ To create a Microsoft.KeyVault/vaults resource, add the following JSON to your t
"vaultUri": "string"
},
"tags": {
"{customized property}": "string"
"[key (string)]": "string"
}
}
```
Expand Down Expand Up @@ -529,7 +529,7 @@ resource "azapi_resource" "symbolicname" {
}
})
tags = {
{customized property} = "string"
"[key (string)]" = "string"
}
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ resource symbolicname 'Microsoft.Resources/resourceGroups@2024-07-01' = {
name: 'string'
properties: {}
tags: {
{customized property}: 'string'
'[key (string)]': 'string'
}
}
```
Expand Down Expand Up @@ -139,7 +139,7 @@ To create a Microsoft.Resources/resourceGroups resource, add the following JSON
"properties": {
},
"tags": {
"{customized property}": "string"
"[key (string)]": "string"
}
}
```
Expand Down Expand Up @@ -208,7 +208,7 @@ resource "azapi_resource" "symbolicname" {
}
})
tags = {
{customized property} = "string"
"[key (string)]" = "string"
}
}
```
Expand Down
6 changes: 3 additions & 3 deletions src/TemplateRefGenerator/Generators/CodeSampleGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void AddProperty(string name, Action writeValue)
}
if (!props.Any() && additionalPropType is {})
{
AddProperty("{customized property}", () => GenerateBicep(sb, indentLevel + 1, additionalPropType.Type, $"{path}.*", visited));
AddProperty("'[key (string)]'", () => GenerateBicep(sb, indentLevel + 1, additionalPropType.Type, $"{path}.*", visited));
}
sb.Append(indent + "}");
break;
Expand Down Expand Up @@ -234,7 +234,7 @@ void AddProperty(string name, bool isLast, Action writeValue)
}
if (!props.Any() && additionalPropType is {})
{
AddProperty("{customized property}", true, () => GenerateArmTemplateJson(resource, sb, indentLevel + 1, additionalPropType.Type, $"{path}.*", visited));
AddProperty("[key (string)]", true, () => GenerateArmTemplateJson(resource, sb, indentLevel + 1, additionalPropType.Type, $"{path}.*", visited));
}
sb.Append(indent + "}");
break;
Expand Down Expand Up @@ -366,7 +366,7 @@ void AddProperty(string name, Action writeValue)
}
if (!props.Any() && additionalPropType is {})
{
AddProperty("{customized property}", () => GenerateTerraform(resource, sb, indentLevel + 1, additionalPropType.Type, $"{path}.*", visited));
AddProperty("\"[key (string)]\"", () => GenerateTerraform(resource, sb, indentLevel + 1, additionalPropType.Type, $"{path}.*", visited));
}

sb.Append(indent + "}");
Expand Down