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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user