fix: parse MCP result payloads and drop place idempotency_key

Typed result structs replace empty envelopes. Equity place sends
ref_id only so live additionalProperties:false schemas accept the call.
This commit is contained in:
2026-09-01 14:18:39 -05:00
parent f52a19181d
commit a6bf8632ce
22 changed files with 2225 additions and 74 deletions
+14
View File
@@ -241,3 +241,17 @@ func TestEarningsResults_rhntest(t *testing.T) {
t.Fatal(diff)
}
}
func TestEarningsResults_liveEnvelope(t *testing.T) {
t.Parallel()
c := market.New(client.Func(func(ctx context.Context, name string, args map[string]any) (json.RawMessage, error) {
return json.RawMessage(`{"data":{"results":[{"report":{"date":"2026-07-15"}}]}}`), nil
}))
got, err := c.EarningsResults(context.Background(), market.EarningsResultsRequest{Symbol: "MU"})
if err != nil {
t.Fatal(err)
}
if got.ReportDate != "2026-07-15" || got.NextReportDate != "2026-07-15" {
t.Fatalf("%+v", got)
}
}