workos/workos-kotlin

Unknown directory type causes deserialization failure

Closed this issue · 5 comments

We are getting the following error:

java.security.SignatureException: Invalid signature: Cannot deserialize value of type `com.workos.directorysync.models.DirectoryType` from String "onelogin scim v2.0": not one of the values accepted for Enum class: [...]

It seems like it's probably bad design to use a java enum for a dynamic field like this in a client library since java enums aren't able to represent unknown values.

Obviously a short term fix is to just add the enum variant for onelogin, but I think you should consider making this field a String.

Thanks @singron for the report. For the time being we can add the missing type to unblock you.

The team and I will discuss potential approaches to make this more resilient in the future.

Any update on this? The same thing happened again.