You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
This is related to Issue 81. I am working with a SCIM provider that includes non-standard attributes on their urn:ietf:params:scim:api:messages:2.0:Error objects, causing deserialization to fail. I tried customizing deserialization by setting JsonUtils' MapperFactory, but to no effect.
To Reproduce
Here's a code snippet for reproducing issue. Note the non-standard attributes in the ErrorResponse JSON, code, entity_id, and message.
String errorResponseJson =
"""
{
"code": "uniqueness",
"entity_id": "thanh.veum",
"message": "Another user already exists with this username 'thanh.veum'",
"detail": "Another user already exists with this username 'thanh.veum'",
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:Error"
],
"status": 409
}""";
MapperFactory factory = new MapperFactory();
factory.setDeserializationCustomFeatures(Map.of(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false));
JsonUtils.setCustomMapperFactory(factory);
// Throws exception
JsonUtils
.getObjectReader()
.forType(ErrorResponse.class)
.readValue(errorResponseJson);
Here's the stack trace that results:
Exception in thread "main" com.fasterxml.jackson.databind.JsonMappingException: Core attribute message is undefined for schema urn:ietf:params:scim:api:messages:2.0:Error
at com.fasterxml.jackson.databind.deser.SettableAnyProperty._throwAsIOE(SettableAnyProperty.java:304)
at com.fasterxml.jackson.databind.deser.SettableAnyProperty.set(SettableAnyProperty.java:267)
at com.fasterxml.jackson.databind.deser.impl.PropertyValue$Any.assign(PropertyValue.java:101)
at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:223)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:453)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1497)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:348)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342)
at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:2125)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1566)
at scratch.Scratch.main(Scratch.java:35)
Caused by: com.unboundid.scim2.common.exceptions.BadRequestException: Core attribute message is undefined for schema urn:ietf:params:scim:api:messages:2.0:Error
at com.unboundid.scim2.common.exceptions.BadRequestException.invalidSyntax(BadRequestException.java:270)
at com.unboundid.scim2.common.BaseScimResource.setAny(BaseScimResource.java:231)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.fasterxml.jackson.databind.introspect.AnnotatedMethod.callOnWith(AnnotatedMethod.java:118)
at com.fasterxml.jackson.databind.deser.SettableAnyProperty$MethodAnyProperty._set(SettableAnyProperty.java:363)
at com.fasterxml.jackson.databind.deser.SettableAnyProperty.set(SettableAnyProperty.java:263)
... 10 more
Caused by: com.unboundid.scim2.common.exceptions.BadRequestException: Core attribute message is undefined for schema urn:ietf:params:scim:api:messages:2.0:Error
Expected behavior
I would expect deserialization to succeed, with the resulting Java object constructed on the basis on the standard attributes only.
Additional context
Jackson version: 2.18.2
SCIM 2 SDK version: 3.2.0
The text was updated successfully, but these errors were encountered:
Description
This is related to Issue 81. I am working with a SCIM provider that includes non-standard attributes on their
urn:ietf:params:scim:api:messages:2.0:Error
objects, causing deserialization to fail. I tried customizing deserialization by settingJsonUtils
'MapperFactory
, but to no effect.To Reproduce
Here's a code snippet for reproducing issue. Note the non-standard attributes in the
ErrorResponse
JSON,code
,entity_id
, andmessage
.Here's the stack trace that results:
Expected behavior
I would expect deserialization to succeed, with the resulting Java object constructed on the basis on the standard attributes only.
Additional context
The text was updated successfully, but these errors were encountered: