Is there a way to allow content editors to upload JSON files and then be able to query the JSON data?
I guess you could use a plain text field and allow pasting the JSON directly in there and then parse it in the page templates, but this seems very prone to error so I don’t want to do this.
Another option would be to use a file upload input, but again prone to error as there is no validation available to restrict which file types you can upload (i.e. only
.json files). This also only return a URL to the hosted JSON file, and not the file contents, so would then have to make a run-time request to fetch the data, so also don’t want to go down this route.
Am I missing something? Is there a good way to do this?
This particular use case is for Lottie animations which are exported as JSON files and I’d like to allow content editors to be able to change this as they please, just like any other image.