Skip to content

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

@yonjah

Description

@yonjah

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

Metadata

Metadata

Assignees

Labels

breaking changesChange that can breaking existing codebugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions