Skip to content

Commit

Permalink
fix: validate the min length of series field at charts series endpo…
Browse files Browse the repository at this point in the history
…int (#477)
  • Loading branch information
wrn14897 authored Jul 16, 2024
1 parent 0be2d25 commit 90a5ca7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fair-lizards-yawn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperdx/api': patch
---

fix: validate the min length of series field at charts series endpoint
2 changes: 1 addition & 1 deletion packages/api/src/routers/api/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ router.post(
'/series',
validateRequest({
body: z.object({
series: z.array(chartSeriesSchema),
series: z.array(chartSeriesSchema).min(1),
endTime: z.number(),
granularity: z.nativeEnum(clickhouse.Granularity).optional(),
startTime: z.number(),
Expand Down
1 change: 1 addition & 0 deletions packages/api/src/routers/external-api/v1/charts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ router.post(
body: z.object({
series: z
.array(externalQueryChartSeriesSchema)
.min(1)
.max(5)
.refine(
series => {
Expand Down

0 comments on commit 90a5ca7

Please sign in to comment.