We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I have a map with a Date object it isn't serialized according to serializers and configuration eg
Ghost ghost = new Ghost(); ghost.setDateTime(LocalDateTime.now()); Map<String, Object> properties = new HashMap<>(); ghost.setProperties(properties); properties.put("testtest", LocalDateTime.now()); JsonbConfig config = new JsonbConfig() .withDateFormat("yyyy", Locale.ENGLISH); Jsonb jsonb = JsonbBuilder.create(config); String json = jsonb.toJson(ghost); System.out.println(json); Pattern pattern = Pattern.compile("\\d+:\\d+:\\d+"); Matcher hoursMatcher = pattern.matcher(json); Assert.assertFalse("Should not contain hours", hoursMatcher.find());
Returns this json:
{"dateTime":"2017","properties":{"testtest":"2017-09-11T15:44:34.979"}}
The first date is okay but the second one is not using the configured format ("yyyy").
You can find a working example here:
https://github.com/dAti/yassonkaput/tree/master/src/test/java
The text was updated successfully, but these errors were encountered:
Any idea when this will be released?
Sorry, something went wrong.
No branches or pull requests
When I have a map with a Date object it isn't serialized according to serializers and configuration eg
Returns this json:
{"dateTime":"2017","properties":{"testtest":"2017-09-11T15:44:34.979"}}
The first date is okay but the second one is not using the configured format ("yyyy").
You can find a working example here:
https://github.com/dAti/yassonkaput/tree/master/src/test/java
The text was updated successfully, but these errors were encountered: