DScheglov/mongoose-schema-jsonschema

Mongoose validators are converted incorrectly

conmanet opened this issue · 2 comments

I have this mongoose schema:

name: {
    type: String,
    maxlength: [256, 'Why name is too long?'] // Mongoose validator: https://mongoosejs.com/docs/validation.html#built-in-validators
},

Calling jsonSchema() give me the output with maxLength is an array.

Expected result:

maxLength: 256

@conmanet thanks for reporting the bug.
Will fix it soon.
ETA (approximately): June 8, 2020

Fixed in v1.4.4

Commit: 9e30750