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}