0

I'm looking for the best way to use a JSON string as the variable data for a Liquid.NET template. I don't know the structure of the JSON so I am unable to deserialize it to a POCO before using it.

I attempted to use the .ToLiquid() extension method on a JSON.Net JObject but it throws a memory exception.

I may need to convert the JSON to a LiquidHash before merging it with the template. Is there a utility that provides this or do I need to iterate over all the nodes myself?

https://github.com/mikebridge/Liquid.NET

Vyrotek
  • 5,356
  • 5
  • 45
  • 70
  • Perhaps @mikebridge could shed some light here? :) – Vyrotek Mar 04 '16 at 15:27
  • 1
    Yes, unfortunately there's no direct conversion from a JSON object to a LiquidHash. It might be a useful feature to be able to import a JSON.Net datastructure but it's not there at the moment. – mikebridge Mar 04 '16 at 16:17

1 Answers1

1

You currently need to generate a LiquidHash manually.

Vyrotek
  • 5,356
  • 5
  • 45
  • 70