Skip to content

custId and teamid should be optional for ResultsSearchSeris schema#6

Open
dan-gamble wants to merge 1 commit into
AllyMurray:mainfrom
dan-gamble:patch-2
Open

custId and teamid should be optional for ResultsSearchSeris schema#6
dan-gamble wants to merge 1 commit into
AllyMurray:mainfrom
dan-gamble:patch-2

Conversation

@dan-gamble
Copy link
Copy Markdown
Contributor

In future should probably look to make this an enum of the minimum that is required i.e. year + quarter

In future should probably look to make this an enum of the minimum that is required i.e. `year + quarter`
@AllyMurray
Copy link
Copy Markdown
Owner

AllyMurray commented Mar 16, 2026

Hey @dan-gamble, thanks for raising this. Just wanted to clarify what's going on here.

The schema you changed (ResultsSearchSeries) is the response schema. It validates the shape of the data the API sends back.

The request params schema (ResultsSearchSeriesParamsSchema) already has both custId and teamId as optional:

const ResultsSearchSeriesParamsSchema = z.object({
  // ...
  custId: z.optional(z.number()),
  teamId: z.optional(z.number()),
  // ...
});

So you shouldn't need to provide them when making requests.

The types are generated from API response samples via sdk:generate. Do you have an example of a response where the API didn't include cust_id/team_id in the echoed params? If so I can add it as variant sample data so the generator picks up the optionality.

@AllyMurray
Copy link
Copy Markdown
Owner

Hi @dan-gamble, did you see my previous comment? I don't want to just close this when you went to the effort of raising a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants