RealDevSquad / RealDevSquad/website-backend

Fix `joi` validation for payload data

Open
#916 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backend bug
Dominant language
JavaScript
Stars
74
Forks
276
Avg merge
1d 26m
Merged PRs (30d)
14

Description

Issue

Currently the joi validation limit is for minimum characters required but it should be actually minimum words required because of the expectation from the feature

  • Here, min(limit) method for string characters not for words entered.
    image

Solution

  • Fix the validation to check for number of words not for number of characters.

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

Search the payload validation code for the Joi min(limit) usage and inspect how the submitted data is validated. Confirm the intended word-count behavior with the existing validation flow, then verify that values are accepted or rejected according to the required number of words.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.