File tree Expand file tree Collapse file tree 3 files changed +6
-1
lines changed
jackson/src/main/java/org/linguafranca/pwdb/kdbx/jackson Expand file tree Collapse file tree 3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -194,6 +194,9 @@ public boolean shouldProtect(String s) {
194194 }
195195
196196 public List <KeePassFile .Binary > getBinaries () {
197+ if (keePassFile .meta .binaries == null ) {
198+ keePassFile .createBinaries ();
199+ }
197200 return keePassFile .meta .binaries ;
198201 }
199202
Original file line number Diff line number Diff line change 1717
1818import com .ctc .wstx .api .WstxInputProperties ;
1919import com .ctc .wstx .api .WstxOutputProperties ;
20+ import com .fasterxml .jackson .annotation .JsonInclude ;
2021import com .fasterxml .jackson .databind .DeserializationFeature ;
2122import com .fasterxml .jackson .databind .MapperFeature ;
2223import com .fasterxml .jackson .databind .SerializationFeature ;
@@ -98,6 +99,7 @@ public void save(OutputStream outputStream) {
9899 mapper .enable (ToXmlGenerator .Feature .WRITE_XML_DECLARATION );
99100 mapper .enable (SerializationFeature .INDENT_OUTPUT );
100101 mapper .disable (SerializationFeature .FAIL_ON_EMPTY_BEANS );
102+ mapper .setSerializationInclusion (JsonInclude .Include .NON_EMPTY );
101103
102104 // set the serializer to Woodstox
103105 System .setProperty ("javax.xml.stream.XMLOutputFactory" , "com.ctc.wstx.stax.WstxOutputFactory" );
Original file line number Diff line number Diff line change 1616
1717<KeePassFile >
1818 <Meta >
19- <Generator >Keepass-Java-2 </Generator >
19+ <Generator >KeePassJava2 </Generator >
2020 <HeaderHash ></HeaderHash >
2121 <DatabaseName >New Database</DatabaseName >
2222 <DatabaseNameChanged >${creationDate}</DatabaseNameChanged >
You can’t perform that action at this time.
0 commit comments