I will reply as there are no responses yet and I've overcame this problem.
Changing the location of param to body
was good approach as it removes that top level JSON element. (This was signaled as a problem, but still - this is how Guzzle behaves.)
To change request to application/json
you can use following description in serviceDescription.json
:
"PostAuthentication": {
"httpMethod": "POST",
"uri": "/xxx-person-service/session",
"summary": "Posts the session object",
"responseClass": "XXX\\WebServicesClientBundle\\Entity\\ProfessionalSession",
"parameters":{
"session": {
"location": "body",
"required": true
},
"session-identifier": {
"location": "header",
"required": true,
"sentAs": "HTTP_X_SESSION_KEY"
},
//THIS is what you need:
"content-type": {
"location": "header",
"static": true,
"required" : true,
"default" : "application/json",
"sentAs" : "Content-Type"
}
}
},