Closed Mairu closed 1 year ago
Originally reported through PR https://github.com/Twipped/joi-to-swagger/pull/98
Commonly this library ignores Joi.ref() what is fine, but in this case it generates invalid .json which can't be compiled
Joi implementation example
Joi.object({ durationFrom: Joi.number().integer().min(0).max(999).optional().allow(null).example(10), durationTo: Joi.number().integer().min(Joi.ref('/body.durationFrom')).max(999).optional().allow(null).example(10) })
will generate
{ "durationFrom": { "type": "integer", "minimum": 0, "maximum": 999, "nullable": true, "example": 10 }, "durationTo": { "type": "integer", "minimum": { "adjust": null, "in": false, "iterables": null, "map": null, "separator": ".", "type": "value", "ancestor": "root", "path": [ "body", "durationFrom" ], "depth": 2, "key": "body.durationFrom", "root": "body", "display": "ref:root:body.durationFrom" }, "maximum": 999, "nullable": true, "example": 10 } }
Originally reported through PR https://github.com/Twipped/joi-to-swagger/pull/98
Commonly this library ignores Joi.ref() what is fine, but in this case it generates invalid .json which can't be compiled
Joi implementation example
will generate