dialexa / relish Goto Github PK
View Code? Open in Web Editor NEWBetter error messages for Hapi.js Joi validation
Home Page: https://npmjs.com/package/relish
License: ISC License
Better error messages for Hapi.js Joi validation
Home Page: https://npmjs.com/package/relish
License: ISC License
Joi 11.0.0 introduced a breaking change that changed how paths are represented in the error object.
Hapi 16.6.1 updated Joi to 11.0.0
Example of supporting new paths array is hapijs/hapi#3582
The version of hoek being used has a security issue.
Vulnerable: <= 4.2.0 || >= 5.0.0 < 5.0.3
Patched: > 4.2.0 < 5.0.0 || >= 5.0.3
When I am passing without any fields on the post method, it doesn't show fields required message rather it shows one error as base object empty. I want all the field errors on that. Is that possible?
data: Joi.array().items({
Joi.object({
foo: Joi().string().required()
})
});
How can I set a specific message for foo?
'data.0.foo': 'Message works for specific index'
'data.?.foo': 'For all array instances?'
Thanks,
Specifically devDependencies
:
Relish could be used on a express aplication with express validation middleware?
If it is not possible, Could you suggest me an alternative?
Greetings and thank you.
CONTRIBUTING.md
should also be updated with linter instructions
abortEarly
path
/key
hierarchy goes.Add support for Joi .label(name)
in custom error messages.
For example: Please enter {{label}}
would result in Please enter your full name
for the following schema:
name: Joi.string().label('your full name')
Is this planned?
I can make a pull request to add the option for Relish to support response validation if you want.
Possibly use https://github.com/funktionswerk/hapi-i18n
Hi,
Are there any plans to keep maintaining this module? If you want I can help with keeping things up to date.
There a 2 PRs to update the deps, which would be handy.
We use this module so wouldn't be a problem to help keep it up to date.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.