When I use Postman to test my API with a PUT request, I get this error:
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "00-fe50a5f13435f11ef5d27de5f91d3c45-47c1ee82a70305a9-00",
"errors": {
"$.extractionDate": [
"The JSON value could not be converted to System.Nullable`1[System.DateTime]. Path: $.extractionDate | LineNumber: 0 | BytePositionInLine: 704."
]
}
I can see that an empty string that looks like this is being passed to the API:
"extractionDate":""
In my model, I have the ExtractionDate
property set as nullable like this:
public DateTime? ExtractionDate { get; set; }
Due to things beyond my control, the old system that is using this API can't pass nulls, it can only pass a blank string for any values that are null.
Is there something else I need to do in order for the JSON to be valid?
Thanks!