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

defaults in ordered array are not filled #2404

Closed
everhardt opened this issue Jul 15, 2020 · 2 comments · Fixed by #2548
Closed

defaults in ordered array are not filled #2404

everhardt opened this issue Jul 15, 2020 · 2 comments · Fixed by #2548
Assignees
Labels
bug Bug or defect
Milestone

Comments

@everhardt
Copy link
Contributor

Support plan

  • is this issue currently blocking your project? (yes/no): no
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: v14.4.0
  • module version with issue: 17.1.1
  • last module version without issue: unknown
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): standalone
  • any other relevant information:

What are you trying to achieve or the steps to reproduce?

const Joi = require('@hapi/joi');

const schema = Joi.array().ordered(
  Joi.string().required(),
  Joi.number().default(0),
  Joi.number().default(6),
).required();

const validationResult = schema.validate(['test']);

console.log(validationResult.value);

What was the result you got?

['test']

What result did you expect?

['test', 0, 6]

@everhardt everhardt added the support Questions, discussions, and general support label Jul 15, 2020
@hueniverse hueniverse added bug Bug or defect and removed support Questions, discussions, and general support labels Jul 16, 2020
@JatinRanka
Copy link

@hueniverse Can I take up this issue to work on?

@GaldanM
Copy link

GaldanM commented Dec 3, 2020

Would love to see this fixed ! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants