File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/main/java/org/culturegraph/mf/stream/converter Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,8 @@ public void endEntity() {
89
89
@ Override
90
90
public void literal (final String name , final String value ) {
91
91
try {
92
- if (jsonGenerator .getOutputContext ().inObject ()) {
92
+ final JsonStreamContext ctx = jsonGenerator .getOutputContext ();
93
+ if (ctx .inObject ()) {
93
94
jsonGenerator .writeFieldName (name );
94
95
}
95
96
if (value == null ) {
@@ -109,12 +110,12 @@ private void startGroup(final String name) {
109
110
try {
110
111
final JsonStreamContext ctx = jsonGenerator .getOutputContext ();
111
112
if (name .endsWith (ARRAY_MARKER )) {
112
- if (! ctx .inRoot ()) {
113
+ if (ctx .inObject ()) {
113
114
jsonGenerator .writeFieldName (name .substring (0 , name .length () - ARRAY_MARKER .length ()));
114
115
}
115
116
jsonGenerator .writeStartArray ();
116
117
} else {
117
- if (! ctx .inRoot ()) {
118
+ if (ctx .inObject ()) {
118
119
jsonGenerator .writeFieldName (name );
119
120
}
120
121
jsonGenerator .writeStartObject ();
You can’t perform that action at this time.
0 commit comments