[X] I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
Currently, if I call S.string().format('myformat'), it throws following error:
throw new FluentSchemaError(
FluentSchemaError: 'format' must be one of relative-json-pointer, json-pointer, uuid, regex, ipv6, ipv4, hostname, email, url, uri-template, uri-reference, uri, time, date, date-time
This makes it difficult to use any custom format with this library. We should provide option to customize this behavior to support custom formats.
Motivation
I am using ajv for validation, ajv supports adding custom user defined format - Format validation, which takes validate function in which one write any js code to validate the input. Now since this library only takes well defined formats, it's difficult to use this library with ajv.
Prerequisites
🚀 Feature Proposal
Currently, if I call
S.string().format('myformat')
, it throws following error:This makes it difficult to use any custom format with this library. We should provide option to customize this behavior to support custom formats.
Motivation
I am using ajv for validation, ajv supports adding custom user defined format - Format validation, which takes validate function in which one write any js code to validate the input. Now since this library only takes well defined formats, it's difficult to use this library with ajv.
Example
S.string().format('myformat')