I received a json data from gRPC and it is on Pascal case. I want it to be in camel case. I am using angular to access the gRPC service. Even when i serialize and convert the result into camel case, the output in angular is always in Pascal Case. Below are the details.
protobuf message
message EmployeeRecord {
string record = 1;
}
gRPC service
var serializedResult = JsonConvert.SerializeObject(fields, new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
});
var result = new Protos.EmployeeRecord() { record = serializedResult };
return result;
angular code
public getEmployees() : void{
this.response = "";
const service = new EmployeeServiceClient(this.gRPCUrl, null);
const request = new EmployeeRecord();
request.setMesssage('');
service.fields(request, null, (err, response: EmployeeRecord) => {
if (err) {
console.log(err);
}
else {
this.response = response.toObject().record;
}
});
}
the result in this.response is always in Pascal Case