loopbackio / loopbackio/loopback-next
Adding custom keyword through ajv "unique" , need to access repository.
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
### 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
Contributor guide
Research direction
Start with the AJV async-validation guide linked in the reproduction and the custom "unique" keyword described in the issue. Determine whether repository or request-context access is supported during LoopBack validation, then document the supported approach and its limitations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100