pingidentity / scim2

The UnboundID SCIM 2.0 SDK for Java
176 stars 72 forks source link

GetGroup throws com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException while fetching group. #146

Closed ghost closed 11 months ago

ghost commented 4 years ago

Describe the bug When we are trying to fetch Group who has some members associated with it. It throws exception.

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "type" (class com.unboundid.scim2.common.types.Member), not marked as ignorable (3 known properties: "value", "display", "$ref"]) at [Source: (org.glassfish.jersey.message.internal.EntityInputStream); line: 1, column: 311] (through reference chain: com.unboundid.scim2.common.types.GroupResource["members"]->java.util.ArrayList[0]->com.unboundid.scim2.common.types.Member["type"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61) ~[jackson-databind-2.10.4.jar:2.10.4] at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:843) ~[jackson-databind-2.10.4.jar:2.10.4] at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1206) ~[jackson-databind-2.10.4.jar:2.10.4]

To Reproduce

  1. Create group.
  2. add Rmember to Group.
  3. getch the same Group again Expected behavior It should give Group details.

Additional context Add any other context about the problem here. For example:

lachee10 commented 4 years ago

Hi,

It seems your server is returning a 'type' field in it's response. The SCIM 2 SDK doesn't know anything about a 'type' field for the Member in the GroupResouce object. Adding a member seems to not require this 'type' field. But when you fetch the Group you get something back.

Here are a few questions that might help to solve this: What server / service are you working with? Who is the vendor? (Every vendor / product seems to interpret the standard a bit differently) What does the 'Schema' of your server product say about the attributes of the 'Group' -> 'Member' object? (Maybe you need to develop your own 'Group' resource class and include the 'type' attribute in your own implementation).

When I wrote a client application I checked the 'Schema' of the target server and that 'Schema' claimed to (additionally) provide a 'type' field for the 'Member' object. And there were a bunch of other issues with the provided 'Schema', which I had to workaround.

ersagarnikam commented 4 years ago

Hi, If I develop my onw Group. Could you please let me know How i can use my Own created Group to ScimService for all group related operation? Thanks, Sagar

lachee10 commented 4 years ago

I'm not sure how your client code looks like. Therefore any advise is a bit hard.

My guess is you need to replace the usage of the 'GroupResource' with your own developed 'Group'.

Have a look at https://github.com/pingidentity/scim2/wiki/Working-with-SCIM-resources#converting-between-basescimresources-and-genericscimresources

ToeBee commented 2 years ago

We are running into this problem when talking to Litmos. There is a type field in the list of group members that causes Jackson to error out.

We have gotten around it by applying the code snippet in #81 in a wrapper we have around this library.

kqarryzada commented 11 months ago

This issue should be resolved with #199, which adds the type field to the Member class. It is currently planned to be released in version 2.4.0 of the UnboundID SCIM 2 SDK.