I’ve encountered an intriguing inconsistency in how functions are converted to JSON across different Jsonnet implementations, specifically between Go/C++, and sjsonnet.
Issue Description
Attempting to manifest a function as JSON output reveals a discrepancy in behavior. The sjsonnet implementation successfully evaluates and converts the function into JSON, whereas the Go and C++ implementations reject it, producing an error.
Hello,
I’ve encountered an intriguing inconsistency in how functions are converted to JSON across different Jsonnet implementations, specifically between Go/C++, and sjsonnet.
Issue Description
Attempting to manifest a function as JSON output reveals a discrepancy in behavior. The sjsonnet implementation successfully evaluates and converts the function into JSON, whereas the Go and C++ implementations reject it, producing an error.
Code Snippet
Expected Behavior
Both implementations should ideally align with their handling of function-to-JSON conversion, following the Jsonnet specification closely.
Error in Go Implementation
Related Observation
When modifying the function f to accept a parameter, sjsonnet produces a different error. While C++/Go implementations produce the same error.
Code Snippet with Parameter
Questions
The inconsistent behavior is confusing to users. Understanding this would ensure jsonnet is portable and behaves predictably across environments.