keystonejs/keystone-classic

TextType - Over-length value validates when both max and min specified

Ouverte

#4 536 ouverte le 28 déc. 2017

 (0 commentaire) (0 réaction) (0 personne assignée)JavaScript (2 288 forks)batch import
4.x candidatebughelp wanted

Métriques du dépôt

Stars
 (14 656 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

Expected behavior

When both max and min are specified in a field definition, over length strings should be refused.

Actual/Current behavior

Over length string accepted

Steps to reproduce the actual/current behavior

Define a field as per below: name: { type: Types.Text, required: true, min: 3, max: 5 }, Enter a string longer than 5 characters Submit

Environment

Keystone master (0ca9eb18c00fb051c579105ae7d283f98b182d8d) Node v9.2.0

Notes

Issue seems to be caused by a922b38a12bad632ef6f5d992ea91b363bb78d4f. If min length validation passes, all other validation results are discarded.

Guide contributeur