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

Serializing a map doesn't use serializers #42

dAti opened this Issue Sep 11, 2017 · 1 comment


None yet
4 participants
Copy link

dAti commented Sep 11, 2017

When I have a map with a Date object it isn't serialized according to serializers and configuration eg

        Ghost ghost = new Ghost();

        Map<String, Object> properties = new HashMap<>();

        JsonbConfig config = new JsonbConfig()
                .withDateFormat("yyyy", Locale.ENGLISH);

        Jsonb jsonb = JsonbBuilder.create(config);

        String json = jsonb.toJson(ghost);

        Pattern pattern = Pattern.compile("\\d+:\\d+:\\d+");
        Matcher hoursMatcher = pattern.matcher(json);
        Assert.assertFalse("Should not contain hours", hoursMatcher.find());

Returns this json:


The first date is okay but the second one is not using the configured format ("yyyy").

You can find a working example here:


This comment has been minimized.

Copy link

ymajoros commented Sep 22, 2017

Any idea when this will be released?

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