Subject: [scim] Referencing individual subattributes in multivalued attributes

From: Eric Fazendin <[email-masked]>
Date: Thu, 8 Oct 2015 08:36:03 -0600

I'm wondering what is the best practice for extracting individual
subattribute values in a multivalued attribute.

Say you had the below SCIM object and you wanted a system to extract the
region value of the home address.  Barring any specific business
requirements, would the right thing be to return a multivalued list of [CA,
KA, KA]?

Related, how problematic would it be to enforce one time use of type for
any given multivalued attribute?  With the below data, the types would need
to be changed to something like home, secondary home, tertiary home.

{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
  "id": "2819c223-7f76-453a-919d-413861904646",
  "userName": "[email-masked]",
  "addresses": [
    {
      "type": "work",
      "streetAddress": "100 Universal City Plaza",
      "locality": "Hollywood",
      "region": "CA",
      "postalCode": "91608",
      "country": "USA",
      "formatted": "100 Universal City Plaza\nHollywood, CA 91608 USA",
      "primary": true
    },
    {
      "type": "home",
      "streetAddress": "456 Hollywood Blvd",
      "locality": "Hollywood",
      "region": "CA",
      "postalCode": "91608",
      "country": "USA",
      "formatted": "456 Hollywood Blvd\nHollywood, CA 91608 USA"
    },
    {
      "type": "home",
      "streetAddress": "123 Oak St",
      "locality": "Topeka",
      "region": "KA",
      "postalCode": "55555",
      "country": "USA",
      "formatted": "123 Oak St\nTopeka, KA 55555 USA"
    },
    {
      "type": "home",
      "streetAddress": "987 Spruce St",
      "locality": "Witchita",
      "region": "KA",
      "postalCode": "55556",
      "country": "USA",
      "formatted": "987 Spruce St\nWitchita, KA 55556 USA"
    }
  ],
  "meta": {
    "resourceType": "User",
    "created": "2010-01-23T04:56:22Z",
    "lastModified": "2011-05-13T04:42:34Z",
    "version": "W\/\"a330bc54f0671c9\"",
    "location":
"https://example.com/v2/Users/2819c223-7f76-453a-919d-413861904646"
  }
}

---

From: Phil Hunt <[email-masked]>
Date: Thu, 8 Oct 2015 09:04:24 -0700

Eric,

It depends on your service providers needs. 

If you allow repeat types then the client would have to use a filter like the following to return or patch a specific value since type is not unique:

filter=addresses[type eq "work" and region eq "KA"]

The server is free to decide on if it wants to enforce uniqueness. It should set uniqueness for type sub- attribute in schema if it does. 

Phil

> On Oct 8, 2015, at 07:36, Eric Fazendin <[email-masked]> wrote:
> 
> I'm wondering what is the best practice for extracting individual subattribute values in a multivalued attribute.
> 
> Say you had the below SCIM object and you wanted a system to extract the region value of the home address.  Barring any specific business requirements, would the right thing be to return a multivalued list of [CA, KA, KA]?
> 
> Related, how problematic would it be to enforce one time use of type for any given multivalued attribute?  With the below data, the types would need to be changed to something like home, secondary home, tertiary home.
> 
> 
> {
> _______________________________________________
> scim mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/scim