Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make certain rules (min/max/length) override themselves revisited #1778

Closed
yonjah opened this issue Apr 3, 2019 · 0 comments
Closed

Make certain rules (min/max/length) override themselves revisited #1778

yonjah opened this issue Apr 3, 2019 · 0 comments
Assignees
Labels
breaking changes Change that can breaking existing code bug Bug or defect
Milestone

Comments

@yonjah
Copy link

yonjah commented Apr 3, 2019

Describe the problem you are trying to fix (provide as much context as possible)

Similar to #1127 it makes sense to allow overriding some rules to allow extending a base schema

const base = Joi.string().min(10)
const short = base.min(3)

I think #1127 asked exactly that but for some reason the fix commit 674a59e ended up only fixing it for arrays

Which API (or modification of the current API) do you suggest to solve that problem ?

min/max/length and other rules that are unique per instance should only respect the last set value

Are you ready to work on a pull request if your suggestion is accepted ?

I can try but I haven't touched Joi internals before so I'll probably need some guidance

@hueniverse hueniverse self-assigned this May 29, 2019
@hueniverse hueniverse added breaking changes Change that can breaking existing code bug Bug or defect labels May 29, 2019
@hueniverse hueniverse added this to the 16.0.0 milestone May 29, 2019
@Marsup Marsup mentioned this issue Jun 9, 2019
@hueniverse hueniverse added the v16 label Aug 10, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking changes Change that can breaking existing code bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants