Can someone explain me why I'm getting 422 error?
I have JSON from Postman and now I'm trying to send this JSON in Locust. BUt all the time I'm getting 422 error.
This is JSON from Postman:
data = {"startDate": "2020-10-01T00:00:00.000Z",
"endDate": "2020-10-11T00:00:00.000Z",
"id": 117,
"title": "Job Postmanowy Contractora 156",
"desc": "Backendowe opowiastki",
"active": true,
"isDraft": false,
"isPaused": false,
"isBlocked": false,
"locationPayload": "{\"locationType\":\"locationPlace\",\"locationName\":\"Wałbrzych, Dolnośląskie, Poland\",\"locationPlace\":\"place.8245570224125220\",\"locationRegion\":\"region.11228101935550230\",\"locationCountry\":\"country.5811537771766020\"}",
"locationName": "Minneapolis, MN, USA",
"workingHours": "No matter",
"employmentType": "other",
"assignmentType": "indi",
"gender": "both",
"minWorkers": 3,
"maxWorkers": 5,
"minHeight": 10,
"minWeight": 10,
"maxHeight": 180,
"maxWeight": 80,
"minAge": 18,
"maxAge": 25,
"minWage": 20,
"maxWage": 20,
"wageFrequency": "per hour",
"paymentType": "credit card",
"updatedBy": null,
"createdAt": "2020-07-10T12:34:18.000Z",
"updatedAt": "2020-07-10T12:34:20.000Z",
"deletedAt": null,
"userId": 100,
"canApply": false,
"applied": false,
"applicationStatus": null,
"isMine": true,
"status": "future",
"isFavourite": false,
"applications": {"applied": 0, "accepted": 0, "declined": 0},
"isEditable": true,
"location": {},
"user": {"id": 100,
"fullName": "Con SzamsungS9 1",
"companyName": "", "rating": null,
"avatar": "files/3859ca8b6afde6838cf3b6fce356dbaf67359d252f5670d87d6a61e3c7149377image-e4212eac-e0b8-40e7-b009-d3907bf51a5a.jpg"},
"languages": ["German", "English", "Spanish", "Hindi", "Italian", "Polish"],
"highlights": ["high-voltage", "heavy materials"]}
With lowercase boolean I have prompts to create parameters, when I change to uppercase I have 422.
This is how i want to post my JSON
self.client.post('/v1/jobs/drafts/', headers=self.headers, data=json.dumps(data))