grafana / grafana-infinity-datasource

CSV, JSON, GraphQL, XML and HTML datasource for grafana.
https://grafana.com/docs/plugins/yesoreyeram-infinity-datasource
Apache License 2.0
765 stars 103 forks source link

Fix error source for invalid JSONata #967

Closed ivanahuckova closed 2 months ago

ivanahuckova commented 2 months ago

This PR does 2 things:

  1. It fixes error source when URL source is selected and there is ErrEvaluatingJSONata error. In code, there was a typo, where instead of checking for ErrEvaluatingJSONata , we were checking ErrInvalidJSONContent twice. Here is the list of all these 3 errors to check: https://github.com/grafana/infinity-libs/blob/c9bd79b3ed2330cc16dcdf818b05dbc42b8355c2/lib/go/jsonframer/errors.go#L7

  2. When using Inline source, there was missing the same check as we have in URL for these errors after using jsonframer.ToFrame. Here we are adding it.

Fixed:

image

Broken (before):

image
ivanahuckova commented 2 months ago

You might need to update the version as well :)

good point! but there are more fixes coming, so I plan to release once there is a bigger batch of fixes done.