Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime type in ScimAttribute #490

Open
BlueRui opened this issue Jan 10, 2024 · 2 comments
Open

DateTime type in ScimAttribute #490

BlueRui opened this issue Jan 10, 2024 · 2 comments

Comments

@BlueRui
Copy link
Contributor

BlueRui commented Jan 10, 2024

Hi,
I tried to create an extension with an attribute of DateTime type. The example on the readme.md file shows it can be set using "type" in ScimAttribute as follows:

  @ScimAttribute(
    description="A Boolean value indicating the User's administrative status.",
    type=Type.BOOLEAN
    )

But ScimAttribute does not seem to support "type". I tried using java.util.Date for DateTime without setting the type in ScimAttribute. But in response, the DateTime value is displayed as the fastTime value as shown below rather than in xsd:dateTime format.

    "urn:mem:params:scim:schemas:extension:DateExtension": {
        "dateModified": 1704302059063,
        "dateCreated": 1704302059063
    }

What's the right way to add a DateTime attribute? Thanks

@BlueRui
Copy link
Contributor Author

BlueRui commented Jan 10, 2024

I figured it out by using @XmlJavaTypeAdapter(Iso8601DateTimeAdapter.class). The readme could be updated.

@bdemers
Copy link
Member

bdemers commented Jan 10, 2024

Agreed!
There are two things at play here:

  • Currently there is a little bit of duplication between the need for the ScimAttribute annotation and the JAXB annotations, The former is used to define the SCIM Schema and the latter for serialization. (there was talk on another issue about potentially reusing the ScimAttribute annotation for some serialization.
  • A missing README example for a date.

Can you send us a PR for the README based on your example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants