Datasource: Use json-iterator configuration compatible with standard library (#30732)

This will make sure that any map keys in JSON is ordered in /api/ds/query response.
This commit is contained in:
Marcus Efraimsson
2021-01-29 15:31:19 +01:00
committed by GitHub
parent 9407cdd51c
commit f62eb28f3e
2 changed files with 11 additions and 2 deletions
+5 -1
View File
@@ -264,5 +264,9 @@ func (df *dataFrames) MarshalJSON() ([]byte, error) {
return nil, err
}
return jsoniter.Marshal(encoded)
// Use a configuration that's compatible with the standard library
// to minimize the risk of introducing bugs. This will make sure
// that map keys is ordered.
jsonCfg := jsoniter.ConfigCompatibleWithStandardLibrary
return jsonCfg.Marshal(encoded)
}