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

Joi 8.x breaks describe().meta in alternatives #851

Closed
Sebmaster opened this issue Mar 18, 2016 · 1 comment
Closed

Joi 8.x breaks describe().meta in alternatives #851

Sebmaster opened this issue Mar 18, 2016 · 1 comment
Assignees
Labels
bug Bug or defect
Milestone

Comments

@Sebmaster
Copy link

Context

  • node version: v5.9.0
  • joi version: 8.0.4
  • environment (node, browser): node
  • used with (hapi, standalone, ...): standalone
  • any other relevant information:

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

Joi 8.0.4 removes meta in the alternative's describe() schema. I'm guessing unintentionally since it's not in the release notes. It also still works for other types.

Repro:

var Joi = require('joi');
var describe = Joi.when('x', {is: Joi.any(), then: Joi.any(), otherwise: Joi.any()}).meta({a: 1}).describe();

console.log(describe.meta);
sebastian@host:~/trello/shop-api$ npm i joi@7
sebastian@host:~/trello/shop-api$ node test
[ { a: 1 } ]
sebastian@host:~/trello/shop-api$ npm i joi@8
sebastian@host:~/trello/shop-api$ node test
undefined
@Marsup Marsup added the bug Bug or defect label Mar 18, 2016
@Marsup Marsup added this to the 8.0.5 milestone Mar 18, 2016
@Marsup Marsup self-assigned this Mar 18, 2016
Marsup added a commit that referenced this issue Mar 18, 2016
@Marsup
Copy link
Collaborator

Marsup commented Mar 18, 2016

Sorry, that was a huge mistake, fix is released. Thanks for letting me know.

@Marsup Marsup closed this as completed Mar 18, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jan 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants