-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugBug or defectBug or defect