Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error converting value "FRX" to type 'System.Nullable`1[Fortnox.SDK.Entities.AbsenceCauseCode]' #231

Closed
jazzn3rd opened this issue Feb 11, 2022 · 3 comments

Comments

@jazzn3rd
Copy link

In AbsenceCauseCode.cs
https://github.com/FortnoxAB/csharp-api-sdk/blob/master/FortnoxSDK/Entities/Absence%20Transactions/AbsenceCauseCode.cs

The enum does not handle FRX (Flextid)

Callstack:

Newtonsoft.Json.JsonSerializationException: Error converting value "FRX" to type 'System.Nullable`1[Fortnox.SDK.Entities.AbsenceCauseCode]'. Path 'AbsenceTransactions[1].CauseCode', line 1, position 426.
 ---> System.ArgumentException: Requested value 'FRX' was not found.
   at Newtonsoft.Json.Utilities.EnumUtils.ParseEnum(Type enumType, NamingStrategy namingStrategy, String value, Boolean disallowNumber)
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateList(IList list, JsonReader reader, JsonArrayContract contract, JsonProperty containerProperty, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateList(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, Object existingValue, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
   at Fortnox.SDK.Serialization.JsonEntitySerializer.Deserialize[T](String json)
   at Fortnox.SDK.Connectors.Base.SearchableEntityConnector`3.GetSinglePage[T](SearchRequest`1 request)
   at Fortnox.SDK.Connectors.Base.SearchableEntityConnector`3.SendAsync[T](SearchRequest`1 request)
   at Fortnox.SDK.Connectors.Base.SearchableEntityConnector`3.BaseFind(BaseSearch searchSettings)
   at Fortnox.SDK.Connectors.AbsenceTransactionConnector.FindAsync(AbsenceTransactionSearch searchSettings)
@richardrandak
Copy link
Collaborator

richardrandak commented Feb 17, 2022

(EDITED)
The documentation does not specify FRX. However, I will add it to the enum.

I checked also attendence codes, there was FLX as Flextid -/+. However, this seems to be changed, in GUI i can see the FRX in absence for Flextid- and NVX in attendence for flextid+, which is also missing from Attendence enum.

Can you confirm this?

@jazzn3rd
Copy link
Author

jazzn3rd commented Feb 17, 2022 via email

richardrandak added a commit that referenced this issue Feb 18, 2022
@richardrandak
Copy link
Collaborator

richardrandak commented Feb 18, 2022

The NVX and FRX codes were added. Update the NuGet to new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants