@@ -160,6 +160,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
160
160
}
161
161
162
162
public XContentBuilder innerToXContent (XContentBuilder builder , Params params ) throws IOException {
163
+ builder .field ("completed" , completed );
163
164
builder .field ("task" , task );
164
165
if (error != null ) {
165
166
XContentHelper .writeRawField ("error" , error , builder , params );
@@ -171,8 +172,16 @@ public XContentBuilder innerToXContent(XContentBuilder builder, Params params) t
171
172
}
172
173
173
174
public static final ConstructingObjectParser <PersistedTaskInfo , ParseFieldMatcherSupplier > PARSER = new ConstructingObjectParser <>(
174
- "persisted_task_info" , a -> new PersistedTaskInfo (true , (TaskInfo ) a [0 ], (BytesReference ) a [1 ], (BytesReference ) a [2 ]));
175
+ "persisted_task_info" , a -> {
176
+ int i = 0 ;
177
+ boolean completed = (boolean ) a [i ++];
178
+ TaskInfo task = (TaskInfo ) a [i ++];
179
+ BytesReference error = (BytesReference ) a [i ++];
180
+ BytesReference response = (BytesReference ) a [i ++];
181
+ return new PersistedTaskInfo (completed , task , error , response );
182
+ });
175
183
static {
184
+ PARSER .declareBoolean (constructorArg (), new ParseField ("completed" ));
176
185
PARSER .declareObject (constructorArg (), TaskInfo .PARSER , new ParseField ("task" ));
177
186
PARSER .declareRawObject (optionalConstructorArg (), new ParseField ("error" ));
178
187
PARSER .declareRawObject (optionalConstructorArg (), new ParseField ("response" ));
0 commit comments