loopbackio / loopbackio/loopback-next

Adding custom keyword through ajv "unique" , need to access repository.

Open
#9,719 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.