2

I have the following json which get from endpoint,

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:response", 
        "urn:scim:schemas:extension:customattrs:2.0:User"
    ], 
    "meta": {
        "resourceType": "User", 
        "created": "2011-08-01T18:29:49.793Z", 
        "lastModified": "2011-08-01T18:29:49.793Z", 
        "version": "W/\"f250dd84f0671c3\""
    }, 
    "userName": "bjensen", 
    "phoneNumbers": [
        {
            "value": "555-555-8377", 
            "type": "work"
        }
    ], 
    "emails": [
        {
            "value": "bjensen@example.com", 
            "type": "work", 
            "primary": true
        }
    ], 
    "urn:scim:schemas:extension:customattrs:2.0:User": {
        "userName": "bjensen", 
        "address": ""
    }
}

please suggest me to parse the json along with schemas "urn:scim:schemas:extension:customattrs:2.0:User" into java object

chanjianyi
  • 607
  • 4
  • 15
  • 35
Vanitha V
  • 123
  • 2
  • 13
  • 1
    Please show the code you trying to use – chanjianyi May 11 '20 at 09:47
  • I did the code for mapping the json to java object using ObjectMapper mapper.convertValue(jsonResponse, UserDTO.class), In UserDTO, created variables (meta, userName, emails, phoneNumbers) But cant able to parse schema's value "urn:scim:schemas:extension:customattrs:2.0:User" – Vanitha V May 11 '20 at 09:59
  • maybe you can replace the key `urn:scim:schemas:extension:customattrs:2.0:User` to `your key`, then parse it – chanjianyi May 13 '20 at 02:39
  • Yes I have added @JsonProperty(urn:scim:schemas:extension:customattrs:2.0:User) in UserDTO . Now able to read property to java object . Thanks chanjianyi – Vanitha V May 13 '20 at 12:24

0 Answers0