I have set my jsConfig to this:
JsConfig.Init(new ServiceStack.Text.Config
{
TextCase = TextCase.SnakeCase
});
When I look at my services, the json payload for requests and response shows snake case if I browse to the service using /metadata.
However, when I use postman to post to the service using snake case (I just copied the sample json for the request from the /metadata page, I get an error for all my fields that are marked that it should not be empty, although the fields are provided in snake case. When I change the fields to PascalCase, the service excepts the fields.
I want to use lower snake case throughout. Below see pictures of my metadata pages.
So doing a post from postman using
{
"file_name": "Customers.csv", "file_size": "2906", "record_count": 27, "user_auth_id": 31, "inserted_records": 0, "updated_records": 0, "deleted_records": 0, "upload_type": "customeraddedit", "status_codes_id": 9
}
does not work but the below work.
{
"FileName": "Customers.csv", "FileSize": "2906", "RecordCount": 27, "UserAuthId ": 31, "InsertedRecords": 0, "UpdatedRecords": 0, "DeletedRecords": 0, "UploadType": "customeraddedit", "StatusCodesId": 9
}