ROS version 7.22.1 stable
The codeblock is DTO for /ip/route. I’ve reversed through postman that with GET request if blackhole check is set in WinBox, then server sends property “blackhole” with empty string. If property is unset in WinBox, blackhole property is omitted.
Now I need to PATCH a route. So everything works fine except for this blackhole check. I’ve tried sending “blackhole”: null or omit the property completely.
In first case the command in log is /ip route set *id blackhole _rest of params_ which obviously doesn’t work.
In second case the command in log is /ip route set *id _rest of params_ which seem equal to uncheking blackhole in Winbox, but the route is still marked as blackhole.
The proposal is: make blackhole property boolean
The question is: how to deal with it with current API?
public sealed record Route
{
[JsonPropertyName(".id")] public string? Id { get; set; }
[JsonPropertyName("active")] public bool? Active { get; set; }
[JsonPropertyName("distance")] public required int Distance { get; set; }
[JsonPropertyName("dynamic")] public bool? Dynamic { get; set; }
[JsonPropertyName("dst-address")] public required IPNetwork DestinationAddress { get; set; }
[JsonPropertyName("gateway")] public string? Gateway { get; set; }
[JsonPropertyName("immediate-gw")] public string? ImmediateGateway { get; set; }
[JsonPropertyName("routing-table")] public required string RoutingTable { get; set; }
[JsonPropertyName("comment")] public string? Comment { get; set; }
[JsonPropertyName("blackhole")] public string? IsBlackhole { get; set; } //property exists = blackhole, null = not blackhole
[JsonPropertyName("scope")] public int Scope { get; set; }
[JsonPropertyName("target-scope")] public int TargetScope { get; set; }
}