Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Project: jackson-dataformat-xml
=== Releases ===
------------------------------------------------------------------------

#508: `XmlMapper` is unable to deserialise into an empty record
(reported by @protazy)
#745: Add feature to include `standalone='yes'` in xml declaration
(contributed by @duoduobingbing)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.fasterxml.jackson.dataformat.xml.records;

import org.junit.jupiter.api.Test;

import com.fasterxml.jackson.dataformat.xml.*;

import static org.junit.jupiter.api.Assertions.assertNotNull;

// [dataformat-xml#508]
public class XmlEmptyRecordDeser508Test extends XmlTestUtil
{
static class EmptyClass508 {
}

public record EmptyRecord508() {
}

private final XmlMapper MAPPER = new XmlMapper();

@Test
public void testEmptyPOJO() throws Exception {
assertNotNull(MAPPER.readValue("<EmptyClass508/>", EmptyClass508.class));
}

@Test
public void testEmptyRecord() throws Exception {
assertNotNull(MAPPER.readValue("<EmptyRecord508/>", EmptyRecord508.class));
}
}