Conversation
…oth the schema and describe() projection
|
felicity looks really cool 👍 |
|
Thank you! |
lib/object.js
Outdated
| } | ||
|
|
||
| return this.createError('object.type', { type: name }, state, options); | ||
| }, { |
There was a problem hiding this comment.
This is not the place to put it, the 2nd argument of _test holds the describe data.
|
Thank you @Marsup for reviewing this so quickly. I have some follow up questions. I want to clarify that 2nd argument of {
name : <name value>,
ctor : [Function <type>]
}Your advice is greatly appreciated. |
|
The latter should be fine. |
|
Just to follow up, I checked in new changes based on the recommendation of changes. |
|
Thanks. |
|
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
For the API
object.type(). I'm extending the meta data storage of the constructor within the schema to be placed inoptions. Also extendingany.describe()to project it to a new item schema within therulesarray. This will help facilitate an object generation of the exact type specified by this API contract. Problem right now is that the type is translated to anameof typeStringand the ability to reproduce viaObject.create()is lost since there is no way to cast it back to the original reference. Support is being added within felicityLet me know if there is a better way of implementing this.
Using the Joi API
Storage within the schema
Within the Transform of
any.describe()