Slice A3a: Add JsonPropertyName to InitiateShadowRunRequest (camelCase support)
- Support camelCase JSON properties (modelId, windowStart, windowEnd, phaseFilter) - FastEndpoints default deserializer expects exact case match - JsonPropertyName enables API contract flexibility (camelCase per REST convention) - Resolves 400 Bad Request when client sends camelCase payload Source: FastEndpoints deserialization pattern, System.Text.Json convention Decision: Add JsonPropertyName attributes to record properties Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,10 +1,16 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace KArtSell.Host.Features.ShadowRun;
|
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 record InitiateShadowRunRequest(
|
||||||
|
[property: JsonPropertyName("modelId")]
|
||||||
Guid ModelId,
|
Guid ModelId,
|
||||||
|
[property: JsonPropertyName("windowStart")]
|
||||||
DateOnly WindowStart,
|
DateOnly WindowStart,
|
||||||
|
[property: JsonPropertyName("windowEnd")]
|
||||||
DateOnly WindowEnd,
|
DateOnly WindowEnd,
|
||||||
|
[property: JsonPropertyName("phaseFilter")]
|
||||||
string PhaseFilter = "All");
|
string PhaseFilter = "All");
|
||||||
|
|||||||
Reference in New Issue
Block a user