-
I am a Jsonnet novice and this is my first time using Grafonnet. I am attaching a version of my Grafonnet. Please let me know if I am abusing concepts such as
Here is my current version:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Jsonnet is a dynamic language, by default it does not provide type safety. However, I've been looking into parameter validation a little while ago, it would allow us to validate the input of the functions against the JSON schema. This is promising but very early and immature, I plan to test it in smaller projects first. There is no timeline to implement this in Grafonnet.
The docstrings are coming from the upstream schema, the developers in grafana/grafana have a lot on their plate and the TODOs originate from the code there. It'll come eventually. Also note the experimental notice on the README, meaning this is still a best-effort at this point.
Most functions will start with
I'm not sure what |
Beta Was this translation helpful? Give feedback.
-
I am not criticizing Grafonnet. It is great! I used it last week to create a 29,000-line JSON dashboard from a 600 line description. By type safety I meant runtime type safety. It might be easy to improve the documentation. For example, https://github.com/grafana/grafonnet/blob/main/docs/API/panel/xyChart/index.md#fn-optionsserieswithscaledistribution shows the complete documentation of It would be very handy to have docs also say "See https://github.com/grafana/grok/blob/main/jsonnet/v10.0.0/kinds/composable/xychart/panelcfg/x/xychart_types_gen.json#L225" The Grok knows its a string. It knows that string has four possible values. A link to the Grok json or even an HTML rendering of the type and enum values would be helpful -- even if extensive documentation was provided in the description field by the Grafana devs. As a Grafana user, I've seen the UI which gives "Linear", "Logarithmic", and "Symlog" for this setting. The Grok has |
Beta Was this translation helpful? Give feedback.
Jsonnet is a dynamic language, by default it does not provide type safety.
However, I've been looking into parameter validation a little while ago, it would allow us to validate the input of the functions against the JSON schema. This is promising but very early and immature, I plan to test it in smaller projects first. There is no timeline to implement this in Grafonnet.
The docstrings are coming from the upstream sche…