Also tried pulling the config into JSON string via...
# dotnet
m
Also tried pulling the config into JSON string via
Get
, and deserialize myself, also doesn't work
Copy code
Console.WriteLine($"============== Get MetricSpecArgs JSON String via Config.Get ==============");
var jsonString = Config.Get("hpa-metrics");
Console.WriteLine($"jsonString: {jsonString}");

Console.WriteLine($"============== Try Deserialize JSON String into MetricSpecArgs ==============");
var deSerializedArgs = System.Text.Json.JsonSerializer.Deserialize<MetricSpecArgs>(jsonString);
Console.WriteLine($"deSerializedArgs.Type: {deSerializedArgs.Type}");
The above code appears to retrieve the JSON string successfully, but not able to deserialize too, it gives the output:
Copy code
============== Get MetricSpecArgs JSON String via Config.Get ==============
    jsonString: {"resource":{"name":"cpu"},"target":{"averageUtilization":50,"type":"Utilization"},"type":"Resource"}

    ============== Try Deserialize JSON String into MetricSpecArgs ==============
    deSerializedArgs.Type: