- support usage of joi.ref() in min/max() with optionally setting .meta({ refValues: {...} })
- allow references when using object.pattern()
- add support for object.pattern() (thanks @JKEnv)
- update dev dependencies
- add GitHub action for running tests
BREAKING CHANGE: override will now also be applied if className is used BREAKING CHANGE: swaggerOverride will not ignore className anymore
- result object will always contain components object now
- Add support for @joi/date usage with format YYYY-MM-DD (thanks @vikaskanani)
- update dependencies
- Add option to override the Joi schema which generates swagger (thanks @melchii)
- Fix boolean false default value not working (thanks @nelsongomes)
- Remove node 8 (and node 10) support because joi removed it with version 17 as well (releasing only as patch an hour after 5.0.0)
- BREAKING CHANGE: Move back to joi with versions >= 17.1.1 after @hapi/joi was deprecated
- updated dependencies
- BREAKING CHANGE: Move joi to @hapi/joi package with version > 16.0 which was a major rewrite
- BREAKING CHANGE: Instead of use joi.object().unknown(false) to disallow additional properties this is the default now. To allow additional properties use joi.object().unknown()
- BREAKING CHANGE: removed support for "swaggerIndex", because it is no longer needed due to added support of "oneOf, anyOf, allOf" keywords
- add support for OAS3 "oneOf, anyOf, allOf and not" keywords
- this functionality is reflected in the processing of
joi.when()
conditions,joi.alternatives()
andjoi.array().items()
- this functionality is reflected in the processing of
- add support for "switch" condition -
joi.when('x', { is: true, switch: { ... } })
- add support for "invalid" method -
joi.string().invalid('A','B','C')
- add add support for "uuid" format for string type
- add support for ES6 default import syntax
- fix string token pattern
- add support to handle custom types via joi.extend (thanks to @qbikez)
- Use lodash instead of lodash subpackages (thanks to @sabdullahpear)
- Add Typescript typings (thanks to @Mairu)
- Fix joi .example() for joi >= 14.x (thanks to @lucasconstantino and @DragFAQ)
- Add file support (thanks to @qwang1113)
- Fix for crash when an object property is forbidden, which now works for any data type. (thank you @david-unergie)
- Ignore a
default()
value when it is a function. (thank you @mmed) - Added support for
joi.example()
(thank you @Siilwyn)
- BREAKING CHANGE: Now only supports node 8.9+ and Joi 13.x
- BREAKING CHANGE: J2S now outputs a
components
property instead ofdefinitions
. This contains sub-properties for schemas, properties, etc. By default, any component defined with aclassName
meta value will be put intoschemas
. This can be overridden with theclassTarget
meta value.
.label()
values are now parsed into thetitle
attribute. (Thank you @jimcatts)
- BREAKING CHANGE: J2S now outputs for OpenAPI v3 / Swagger 3 specification.
- Definitions are now targeted for
#/components/schemas/
(Thank you @pato1) - Nullable values now output the
nullable: true
attribute instead of passing the non-standard type array. (Thank you @pato1) - Regular expressions passed for matching on lower case and uppercase strings now omit opening and closing slashes. (Thank you @h2non)
- Definitions are now targeted for
- Added support for joi.forbidden() (Thank you @cjnqt)
- Fixed an undefined function error when an object definition lacked keys (Thank you @zcstarr)
- Added support for joi.when() (Thank you @buglavere)