private final TransactionServicesWrapper services;
private final DOMMountPointServiceHandler mountPointServiceHandler;
+ private final SchemaContextHandler schemaContextHandler;
public JSONRestconfServiceRfc8040Impl(final TransactionServicesWrapper services,
- final DOMMountPointServiceHandler mountPointServiceHandler) {
+ final DOMMountPointServiceHandler mountPointServiceHandler,
+ final SchemaContextHandler schemaContextHandler) {
this.services = services;
this.mountPointServiceHandler = mountPointServiceHandler;
+ this.schemaContextHandler = schemaContextHandler;
}
@SuppressWarnings("checkstyle:IllegalCatch")
final InputStream entityStream = new ByteArrayInputStream(payload.getBytes(StandardCharsets.UTF_8));
- JsonToPatchBodyReader jsonToPatchBodyReader = new JsonToPatchBodyReader();
+ JsonToPatchBodyReader jsonToPatchBodyReader = new JsonToPatchBodyReader(schemaContextHandler);
final PatchContext context = jsonToPatchBodyReader.readFrom(uriPath, entityStream);
LOG.debug("Parsed YangInstanceIdentifier: {}", context.getInstanceIdentifierContext().getInstanceIdentifier());
private NormalizedNodeContext toNormalizedNodeContext(final String uriPath, @Nullable final String payload,
final boolean isPost) throws OperationFailedException {
final InstanceIdentifierContext<?> instanceIdentifierContext = ParserIdentifier.toInstanceIdentifier(
- uriPath, SchemaContextHandler.getSchemaContext(),
- Optional.of(mountPointServiceHandler.get()));
+ uriPath, schemaContextHandler.get(), Optional.of(mountPointServiceHandler.get()));
if (payload == null) {
return new NormalizedNodeContext(instanceIdentifierContext, null);