jsonnet icon indicating copy to clipboard operation
jsonnet copied to clipboard

C api should expose jsonnet types

Open mikedanese opened this issue 9 years ago • 2 comments

To embbed jsonnet in an application as a config language, you often want it to produce a traversable structure. Right now you can evaluate and then reinterpret the char* with a different json parser which is painful:

https://github.com/mikedanese/overlay/blob/master/main.c#L195-L206

mikedanese avatar May 29 '16 16:05 mikedanese

It looks like this is what JsonnetJsonValue is intended to be?

mikedanese avatar May 29 '16 16:05 mikedanese

Yeah I was thinking that jsonnet_execute_snippet and friends should return a JsonnetJsonValue instead of a string so you don't have to parse it back again. Although that does go against the direction we've previously talked about with custom manifesters that always return string (for -S, --yaml-stream, and similar applications). In that case you always manifest in Jsonnet so the client should receive a string, not the intermediate JSON.

sparkprime avatar May 30 '16 16:05 sparkprime