Json2CSharp / Json2CSharpCodeGenerator

Microsoft Reciprocal License
292 stars 81 forks source link

Converting issue - JSON to Dart #117

Open GuttiDK opened 1 month ago

GuttiDK commented 1 month ago

image

Issue:

System.NotSupportedException: Unsupported json type: NonConstrained at Xamasoft.JsonClassGenerator.CodeWriters.DartCodeWriter.GetTypeName(JsonType type) in C:\Users\Hilal\OneDrive\Desktop\Json2CSharpCodeGenerator\JsonClassGeneratorLib\CodeWriters\DartCodeWriter.cs:line 53 at Xamasoft.JsonClassGenerator.CodeWriters.DartCodeWriter.GetTypeName(JsonType type) in C:\Users\Hilal\OneDrive\Desktop\Json2CSharpCodeGenerator\JsonClassGeneratorLib\CodeWriters\DartCodeWriter.cs:line 37 at Xamasoft.JsonClassGenerator.JsonType.GetTypeName() in C:\Users\Hilal\OneDrive\Desktop\Json2CSharpCodeGenerator\JsonClassGeneratorLib\JsonType.cs:line 157 at Xamasoft.JsonClassGenerator.CodeWriters.DartCodeWriter.WriteClassMembers(StringBuilder sw, JsonType type, String prefix) in C:\Users\Hilal\OneDrive\Desktop\Json2CSharpCodeGenerator\JsonClassGeneratorLib\CodeWriters\DartCodeWriter.cs:line 115 at Xamasoft.JsonClassGenerator.CodeWriters.DartCodeWriter.WriteClass(StringBuilder sw, JsonType type) in C:\Users\Hilal\OneDrive\Desktop\Json2CSharpCodeGenerator\JsonClassGeneratorLib\CodeWriters\DartCodeWriter.cs:line 93 at Xamasoft.JsonClassGenerator.CodeWriters.DartCodeWriter.WriteClassesToFile(StringBuilder sw, IEnumerable`1 types, Boolean rootIsArray) in C:\Users\Hilal\OneDrive\Desktop\Json2CSharpCodeGenerator\JsonClassGeneratorLib\CodeWriters\DartCodeWriter.cs:line 220 at Xamasoft.JsonClassGenerator.JsonClassGenerator.GenerateClasses(String jsonInput, String& errorMessage) in C:\Users\Hilal\OneDrive\Desktop\Json2CSharpCodeGenerator\JsonClassGeneratorLib\JsonClassGenerator.cs:line 78

GuttiDK commented 1 month ago

Data:

{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "storageAccounts_thebigdata_name": { "defaultValue": "thebigdata", "type": "String" } }, "variables": {}, "resources": [ { "type": "Microsoft.Storage/storageAccounts", "apiVersion": "2023-04-01", "name": "[parameters('storageAccounts_thebigdata_name')]", "location": "francecentral", "sku": { "name": "Standard_RAGRS", "tier": "Standard" }, "kind": "StorageV2", "properties": { "dnsEndpointType": "Standard", "defaultToOAuthAuthentication": false, "publicNetworkAccess": "Enabled", "allowCrossTenantReplication": false, "minimumTlsVersion": "TLS1_2", "allowBlobPublicAccess": true, "allowSharedKeyAccess": true, "largeFileSharesState": "Enabled", "networkAcls": { "bypass": "AzureServices", "virtualNetworkRules": [], "ipRules": [], "defaultAction": "Allow" }, "supportsHttpsTrafficOnly": true, "encryption": { "requireInfrastructureEncryption": false, "services": { "file": { "keyType": "Account", "enabled": true }, "blob": { "keyType": "Account", "enabled": true } }, "keySource": "Microsoft.Storage" }, "accessTier": "Hot" } }, { "type": "Microsoft.Storage/storageAccounts/blobServices", "apiVersion": "2023-04-01", "name": "[concat(parameters('storageAccounts_thebigdata_name'), '/default')]", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_thebigdata_name'))]" ], "sku": { "name": "Standard_RAGRS", "tier": "Standard" }, "properties": { "containerDeleteRetentionPolicy": { "enabled": true, "days": 7 }, "cors": { "corsRules": [] }, "deleteRetentionPolicy": { "allowPermanentDelete": false, "enabled": true, "days": 7 } } }, { "type": "Microsoft.Storage/storageAccounts/fileServices", "apiVersion": "2023-04-01", "name": "[concat(parameters('storageAccounts_thebigdata_name'), '/default')]", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_thebigdata_name'))]" ], "sku": { "name": "Standard_RAGRS", "tier": "Standard" }, "properties": { "protocolSettings": { "smb": {} }, "cors": { "corsRules": [] }, "shareDeleteRetentionPolicy": { "enabled": true, "days": 7 } } }, { "type": "Microsoft.Storage/storageAccounts/queueServices", "apiVersion": "2023-04-01", "name": "[concat(parameters('storageAccounts_thebigdata_name'), '/default')]", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_thebigdata_name'))]" ], "properties": { "cors": { "corsRules": [] } } }, { "type": "Microsoft.Storage/storageAccounts/tableServices", "apiVersion": "2023-04-01", "name": "[concat(parameters('storageAccounts_thebigdata_name'), '/default')]", "dependsOn": [ "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccounts_thebigdata_name'))]" ], "properties": { "cors": { "corsRules": [] } } } ] }