0

how to check only one value is accepted when the request is inserted? if both values are passes then send the error message using json. Either RegNumber or Pan should be accepted. i am very new to this

{  
  "email_id": "sample@example.com",
  "RegNumber": "AM47",
  "FromDate": 062020,
  "ToDate": 062022,
  "SchemaCode": 560043,
  "PAN": "ABC44X"
}
James Z
  • 12,209
  • 10
  • 24
  • 44
Maha
  • 15
  • 1
  • 7

1 Answers1

0

I think you meant by get error in json response means app should return Json when it crashes, so to do, we must use middlewares and when you expect some error in response override that response error with your own custom json dict with error details.

Parth
  • 101
  • 1
  • 6