-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Extend describe() for type #1028
Conversation
…oth the schema and describe() projection
felicity looks really cool 👍 |
Thank you! |
@@ -656,6 +656,8 @@ internals.Object = class extends Any { | |||
} | |||
|
|||
return this.createError('object.type', { type: name }, state, options); | |||
}, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 therules
array. 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 aname
of typeString
and 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()