From afeba62c7c92dca4075bbfd51559dce528e25ab7 Mon Sep 17 00:00:00 2001
From: David Camacho Cateura <47002519+dcamachoc@users.noreply.github.com>
Date: Wed, 2 Sep 2026 12:53:55 +0200
Subject: [PATCH] feat: Show min / max for integers in mgmt api docs (#49884)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.
YES
## What kind of change does this PR introduce?
Improvement in docs
## What is the current behavior?
Not shown
## What is the new behavior?
Displays min / max when available in OpenAPI specs for integers and
numbers
## Additional context
## Summary by CodeRabbit
* **New Features**
* API reference documentation now displays minimum and maximum
constraints for numeric schema parameters, including `number` and
`integer` types.
---
apps/docs/features/docs/Reference.ui.tsx | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/apps/docs/features/docs/Reference.ui.tsx b/apps/docs/features/docs/Reference.ui.tsx
index c8a2ee5704b..42c984a41e6 100644
--- a/apps/docs/features/docs/Reference.ui.tsx
+++ b/apps/docs/features/docs/Reference.ui.tsx
@@ -474,7 +474,9 @@ export function ApiSchemaParamSubdetails({
if (
!('enum' in schema) &&
'type' in schema &&
- (['boolean', 'number', 'integer'].includes(schema.type) ||
+ (schema.type === 'boolean' ||
+ ((schema.type === 'number' || schema.type === 'integer') &&
+ !('minimum' in schema || 'maximum' in schema)) ||
(schema.type === 'string' &&
!('minLength' in schema || 'maxLength' in schema || 'pattern' in schema)) ||
(schema.type === 'array' &&
@@ -501,7 +503,15 @@ export function ApiSchemaParamSubdetails({
constraint: key,
value: schema[key],
}))
- : []
+ : 'type' in schema && (schema.type === 'number' || schema.type === 'integer')
+ ? ['minimum', 'maximum']
+ .filter((key) => key in schema)
+ .map((key) => ({
+ constraint: key,
+ value: schema[key],
+ }))
+ : []
+
const subContent = asSchemaArray(rawSubContent)
return (
@@ -575,7 +585,10 @@ export function ApiSchemaParamSubdetails({
{String(detail)}
- ) : 'type' in schema && schema.type === 'string' ? (
+ ) : 'type' in schema &&
+ (schema.type === 'string' ||
+ schema.type === 'number' ||
+ schema.type === 'integer') ? (
{detail.constraint}