Opensearch dashboards saved_objects import failing for json file format

Hi,

Until elasticsearch 7.10.2, we were running the REST API cmds to kibana to import json files into saved-objects.
From migration to Opensearch 1.x, the same REST APIs are failing.

 curl -k -u admin:admin -XPOST -H 'osd-xsrf: true' https://kibana.shivani.svc:5601/api/saved_objects/_import?overwrite=true --form file=@one_dashboard.json | jq
 {
   "statusCode": 400,
   "error": "Bad Request",
   "message": "Invalid file extenstion .json"
 }

The error is related to the file extension being json.
When we try the same with a .ndjson file, it works fine.

Pls let us know:

  • if the support for json files in import has been permanently stopped from Opensearch 1.x ?
    If yes, this should have been documented in the breaking changes of Opensearch 1.x release.
  • if not deprecated yet, is there a workaround to still continue to use json files?

Thanks!