diff --git a/src/Web/Controllers/Commands/CommandController.cs b/src/Web/Controllers/Commands/CommandController.cs index 8505698..52b2241 100644 --- a/src/Web/Controllers/Commands/CommandController.cs +++ b/src/Web/Controllers/Commands/CommandController.cs @@ -27,7 +27,7 @@ public class CommandController : ControllerBase Params = cmd.Parameters.Select(dict => new ResponseCommandParam() { Summary = dict.Value.Summary, - Default = dict.Value.DefaultValue, + Default = string.IsNullOrEmpty(dict.Value.DefaultValue) ? null : dict.Value.DefaultValue, Type = dict.Value.Type }).ToList() }); diff --git a/src/Web/Controllers/Commands/ResponseCommandParam.cs b/src/Web/Controllers/Commands/ResponseCommandParam.cs index 2acbca5..c99a113 100644 --- a/src/Web/Controllers/Commands/ResponseCommandParam.cs +++ b/src/Web/Controllers/Commands/ResponseCommandParam.cs @@ -8,7 +8,8 @@ public record ResponseCommandParam public string Summary { get; set; } [JsonPropertyName("default")] - public string Default { get; set; } + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? Default { get; set; } [JsonPropertyName("type")] public string Type { get; set; }