-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 9.3
-
Tags:
-
Upgrade notes:
-
Sprint:nxfit 9.3.1
-
Story Points:5
Directory configured with an integer id field and auto-increment option returns its id as a number instead of a String.
As all the Directory API is based on String id, an entry cannot be updated from the REST API.
When retrieved from the REST API:
GET /nuxeo/api/v1/directory/oauth2Tokens/3
...
properties: {
id: 3,
clientId: 'test-client',
expirationTimeMilliseconds: 3600000
...
}
Updating it with the following (by using the id from the previous call):
PUT /nuxeo/api/v1/directory/oauth2Tokens/3
properties: {
id: 3,
clientId: 'another client',
expirationTimeMilliseconds: 0
...
}
Will lead to the following exception:
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String at org.nuxeo.ecm.restapi.server.jaxrs.directory.DirectoryEntryObject$1.run(DirectoryEntryObject.java:82) at org.nuxeo.ecm.restapi.server.jaxrs.directory.DirectoryEntryObject$1.run(DirectoryEntryObject.java:75) at org.nuxeo.ecm.restapi.server.jaxrs.directory.DirectorySessionRunner.withDirectorySession(DirectorySessionRunner.java:33) at org.nuxeo.ecm.restapi.server.jaxrs.directory.DirectoryEntryObject.doUpdateEntry(DirectoryEntryObject.java:75)
- is required by
-
NXJS-143 Make sure to pass the id field on directory and group endpoints
- Resolved
-
JAVACLIENT-135 Use directory entry id when available
- Resolved