When using the expand parameter in the EmployeeApi , I have this exception
Merge.HRISClient.Client.ApiException
HResult=0x80131500
Message=Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Guid' because the type requires a JSON primitive value (e.g. string, number, boolean, null) to deserialize correctly.
To fix this error either change the JSON to a JSON primitive value (e.g. string, number, boolean, null) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'results[0].employments[0].id', line 1, position 365.
Source=Merge.HRISClient
StackTrace:
at Merge.HRISClient.Client.CustomJsonCodec.Deserialize(IRestResponse response, Type type) in D:\_dev\qomben\qomben-datagenerator\merge-hris-csharp-net-main\src\Merge.HRISClient\Client\ApiClient.cs:line 146
at Merge.HRISClient.Client.CustomJsonCodec.Deserialize[T](IRestResponse response) in D:\_dev\qomben\qomben-datagenerator\merge-hris-csharp-net-main\src\Merge.HRISClient\Client\ApiClient.cs:line 87
at RestSharp.RestClient.Deserialize[T](IRestRequest request, IRestResponse raw)
Most likely because the response contains nested array of Employment, and the corresponding model is just an array of Guid.
Hello,
When using the expand parameter in the
EmployeeApi
, I have this exceptionMost likely because the response contains nested array of Employment, and the corresponding model is just an array of Guid.
here is a sample code
it will be great if you can fix that