Project

General

Profile

Actions

Bug #83

closed

Category Validation Failure with Multiple IDs in Product API (Web-API)

Added by Vivek Kumar 6 days ago. Updated 5 days ago.

Status:
Closed
Priority:
High
Assignee:
-
Start date:
04/15/2026
Due date:
% Done:

100%

Estimated time:
Spent time:

Description

The product creation API incorrectly validates the category field when multiple category IDs are provided as a comma-separated string in a multipart/form-data request.
Although each individual value appears to be a valid MongoDB ObjectId, the backend rejects the request with the error:{"success":false,"message":"Category must be a valid ID"}

Endpoint:
https://api.akinderwellness.com:4001/api/products/add

Steps to Reproduce

  1. Craft a request to the product creation endpoint (multipart/form-data).
  2. Provide multiple category IDs in the category field as a comma-separated string:
  3. category = 69c10cfb7a5370455e2f83bc,69c10cbd7a5370455e2f83ae,69901934d6ca9152e44df413
  4. Send the request.

Observed Result
The API responds with:{"success":false,"message":"Category must be a valid ID"}
Even though all provided values are valid MongoDB ObjectIds.

Expected Result

The API should correctly handle multiple category IDs.

Actions #1

Updated by Vivek Kumar 6 days ago

  • Description updated (diff)
Actions #2

Updated by Adhi Narayanan 6 days ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100
Actions #3

Updated by Vivek Kumar 5 days ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF