Twipped / joi-to-swagger

A library to convert Joi schema objects into Swagger schema definitions
Other
164 stars 63 forks source link

joi.object().keys() vs joi.object({}) #72

Closed ellisium closed 3 years ago

ellisium commented 3 years ago

Hello this is example from doc:

// input
joi.object().keys({
  id:      joi.number().integer().positive().required(),
  name:    joi.string(),
  email:   joi.string().email().required(),
  created: joi.date().allow(null),
  active:  joi.boolean().default(true),
})

But Im trying to transform this format generated from https://github.com/TehShrike/joi-sql

// input
joi.object({
  id:      joi.number().integer().positive().required(),
  name:    joi.string(),
  email:   joi.string().email().required(),
  created: joi.date().allow(null),
  active:  joi.boolean().default(true),
})

it throws an error that it doesnt recognize schema format.

ellisium commented 3 years ago

https://github.com/TehShrike/joi-sql return a string that's why it throw an error. Sorry I close it