Skip to content

Commit 0265a9a

Browse files
committed
tags/entities contraints
1 parent 5026c37 commit 0265a9a

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/utils/openapi.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,19 @@ export function humanizeConstraints(schema: OpenAPISchema): string[] {
491491
res.push(stringRange);
492492
}
493493

494+
if (
495+
!schema.format &&
496+
!schema['x-file-only'] &&
497+
(isArray(schema.type) ? schema.type.includes('string') : schema.type === 'string')
498+
) {
499+
if (schema['x-no-tags']) {
500+
res.push('no tags');
501+
}
502+
if (!schema['x-allow-entities'] && !schema['x-no-tags']) {
503+
res.push('no entities');
504+
}
505+
}
506+
494507
const arrayRange = humanizeRangeConstraint('items', schema.minItems, schema.maxItems);
495508
if (arrayRange !== undefined) {
496509
res.push(arrayRange);

0 commit comments

Comments
 (0)