Slice A3b: Convert InitiateShadowRunRequest to class with JsonPropertyName
- Change from record to class (better JsonPropertyName support) - Add [JsonPropertyName] attributes for camelCase JSON deserialization - Properties: modelId, windowStart, windowEnd, phaseFilter - Resolves 400 Bad Request validation failures Source: FastEndpoints + System.Text.Json deserialization best practice Decision: Class-based DTO with explicit property mapping Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,12 +5,17 @@ namespace KArtSell.Host.Features.ShadowRun;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initiate a 252+ trading-day model validation run.
|
/// Initiate a 252+ trading-day model validation run.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed record InitiateShadowRunRequest(
|
public sealed class InitiateShadowRunRequest
|
||||||
[property: JsonPropertyName("modelId")]
|
{
|
||||||
Guid ModelId,
|
[JsonPropertyName("modelId")]
|
||||||
[property: JsonPropertyName("windowStart")]
|
public Guid ModelId { get; set; }
|
||||||
DateOnly WindowStart,
|
|
||||||
[property: JsonPropertyName("windowEnd")]
|
[JsonPropertyName("windowStart")]
|
||||||
DateOnly WindowEnd,
|
public DateOnly WindowStart { get; set; }
|
||||||
[property: JsonPropertyName("phaseFilter")]
|
|
||||||
string PhaseFilter = "All");
|
[JsonPropertyName("windowEnd")]
|
||||||
|
public DateOnly WindowEnd { get; set; }
|
||||||
|
|
||||||
|
[JsonPropertyName("phaseFilter")]
|
||||||
|
public string PhaseFilter { get; set; } = "All";
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user