import org.opendaylight.restconf.server.spi.FormattableBodySupport;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.rev170126.errors.Errors;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.restconf.rev170126.errors.errors.Error;
+import org.opendaylight.yangtools.yang.data.codec.gson.DefaultJSONValueWriter;
/**
* A {@link FormattableBody} of <a href="https://www.rfc-editor.org/rfc/rfc8040#section-3.9">yang-errors</a> data
if (errorPath != null) {
writer.name(ERROR_PATH);
errorPath.databind().jsonCodecs().instanceIdentifierCodec()
- .writeValue(writer, errorPath.path());
+ .writeValue(new DefaultJSONValueWriter(writer), errorPath.path());
}
writer.name(ERROR_TYPE).value(error.type().elementBody());
writer.endObject();
import org.opendaylight.restconf.common.errors.RestconfError;
import org.opendaylight.restconf.server.api.PatchStatusContext;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.patch.rev170222.yang.patch.status.YangPatchStatus;
+import org.opendaylight.yangtools.yang.data.codec.gson.DefaultJSONValueWriter;
/**
* Result of a {@code PATCH} request as defined in
final var errorPath = restconfError.getErrorPath();
if (errorPath != null) {
writer.name("error-path");
- status.databind().jsonCodecs().instanceIdentifierCodec().writeValue(writer, errorPath);
+ status.databind().jsonCodecs().instanceIdentifierCodec()
+ .writeValue(new DefaultJSONValueWriter(writer), errorPath);
}
final var errorMessage = restconfError.getErrorMessage();
if (errorMessage != null) {