Early (maybe too early) testing of a JSON-RPC adapter for Python shows every spec failing with:
Error: TypeError: DropProxy.wrap: cannot transport Liquid::Spec::LazySpec::SimpleFileSystem
before ever sending a render request. It looks like Liquid::Spec::JsonRpc#render's environment argument is receiving something other than variables with which to render the template.
If I temporarily skip environment wrapping by replacing wrapped_env = DropProxy.wrap(environment, @subprocess.drop_registry) with wrapped_env = environment, every spec fails with:
Error: NoMethodError: undefined method '[]' for nil
before ever sending a render request. In this case Liquid::Spec::JsonRpc#serialize_render_options is expecting a hash but receiving nil.
Hacking past that by passing options || {} to serialize_render_options and inspecting my JSON-RPC server logs shows unexpected parameters for the render method. For example:
{
"jsonrpc": "2.0",
"id": 5,
"method": "render",
"params": {
"template_id": {},
"environment": {
"registers": { "file_system": {} },
"strict_errors": true
},
"options": { "strict_errors": false },
"frozen_time": "2024-01-01T00:01:58Z"
}
}
and
{
"jsonrpc": "2.0",
"id": 21,
"method": "render",
"params": {
"template_id": { "v": null },
"environment": {
"registers": {
"file_system": "#<Liquid::Spec::LazySpec::SimpleFileSystem:0x00007f6a84823fe8>"
},
"strict_errors": true
},
"options": {},
"frozen_time": "2024-01-01T00:01:58Z"
}
}
Every template_id is an object where I was expecting a string value. And environment does indeed contain things that don't look right.
Early (maybe too early) testing of a JSON-RPC adapter for Python shows every spec failing with:
before ever sending a
renderrequest. It looks likeLiquid::Spec::JsonRpc#render'senvironmentargument is receiving something other than variables with which to render the template.If I temporarily skip environment wrapping by replacing
wrapped_env = DropProxy.wrap(environment, @subprocess.drop_registry)withwrapped_env = environment, every spec fails with:before ever sending a
renderrequest. In this caseLiquid::Spec::JsonRpc#serialize_render_optionsis expecting a hash but receivingnil.Hacking past that by passing
options || {}toserialize_render_optionsand inspecting my JSON-RPC server logs shows unexpected parameters for therendermethod. For example:{ "jsonrpc": "2.0", "id": 5, "method": "render", "params": { "template_id": {}, "environment": { "registers": { "file_system": {} }, "strict_errors": true }, "options": { "strict_errors": false }, "frozen_time": "2024-01-01T00:01:58Z" } }and
{ "jsonrpc": "2.0", "id": 21, "method": "render", "params": { "template_id": { "v": null }, "environment": { "registers": { "file_system": "#<Liquid::Spec::LazySpec::SimpleFileSystem:0x00007f6a84823fe8>" }, "strict_errors": true }, "options": {}, "frozen_time": "2024-01-01T00:01:58Z" } }Every
template_idis an object where I was expecting a string value. Andenvironmentdoes indeed contain things that don't look right.