chore: implement requested changes

This commit is contained in:
Ralph Khreish
2025-10-02 11:54:19 +02:00
parent 0aaa105021
commit 7660a29a1a
5 changed files with 213 additions and 15 deletions

View File

@@ -79,9 +79,7 @@ function generateExampleFromSchema(schema) {
if (def.checks) {
const minCheck = def.checks.find((c) => c.kind === 'min');
const maxCheck = def.checks.find((c) => c.kind === 'max');
if (minCheck && minCheck.value >= 20) {
return '<string with at least ' + minCheck.value + ' characters>';
} else if (minCheck && maxCheck) {
if (minCheck && maxCheck) {
return (
'<string between ' +
minCheck.value +
@@ -89,6 +87,8 @@ function generateExampleFromSchema(schema) {
maxCheck.value +
' characters>'
);
} else if (minCheck) {
return '<string with at least ' + minCheck.value + ' characters>';
} else if (maxCheck) {
return '<string up to ' + maxCheck.value + ' characters>';
}