You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ctx
.bind('ajv.keywords.smallNumber')
.to({
name: 'smallNumber', // name of the keyword
type: 'number',
validate: (schema: unknown, data: number) => {
// The number is smaller than 10
const data = async this.repo.find({where:{conditions}});
return !!data;
},
})
.tag(RestTags.AJV_KEYWORD);
Describe the bug
I am adding custom keyword "unique" in loopback 4. It will check whether the entered value is present in db or not.
How can I access repository or request context in "unique" keyword definition or validation.
Logs
No response
Additional information
No response
Reproduction
https://ajv.js.org/guide/async-validation.html
The text was updated successfully, but these errors were encountered: