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

Null key for a Map not allowed in JSON #41

Open
acotiuga opened this issue Aug 11, 2021 · 0 comments
Open

Null key for a Map not allowed in JSON #41

acotiuga opened this issue Aug 11, 2021 · 0 comments

Comments

@acotiuga
Copy link
Contributor

acotiuga commented Aug 11, 2021

There is a particular case, when the uid field is part of the fields mapping, that causes

Failed to serialize object to JSON 
com.fasterxml.jackson.databind.JsonMappingException: Null key for a Map not allowed in JSON (use a converting
NullKeySerializer?) (through reference chain: java.util.LinkedHashMap["users"]->java.util.HashMap["null"])

on https://github.com/xwikisas/application-ldapuserimport/blob/main/application-ldapuserimport-api/src/main/java/com/xwiki/ldapuserimport/internal/DefaultLDAPUserImportManager.java#L289.
For example, if the uid is sn and the mapping contains last_name=sn.
This can happen when the uid is sn because there is a default mapping (first_name=givenName,last_name=sn,email=mail) that improves the usability of the application (it can work without configuring the mapping on UI) and it can also happen when the administrator explicitly configures the mapping to contain it.

What is needed here is a better way of building the users Map.

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

No branches or pull requests

2 participants