Is there an easy way to configure Alfresco's transformation service to treat a mimetype (e.g., "application/json") like a "text/plain" file when rendering a preview or thumbnail?
I've done a bit of digging and I have a sneaking suspicion this is trickier than I think…
Any pointers or references would be greatly appreciated!
Alfresco renders and thumbnails documents based on configuration files so you configure it to "do something" if the mimetype is application/json which can be the same thing as it would do if it were plain text.
The best example of how all this works is video file thumbnailing which is usually included in your distribution as video-thumbnail-context.xml.sample. If you look in this file you will see it checks for an inbound mimetype and if it matches uses ffmpeg to produce a jpeg thumbnail. You just need a similar context to handle application/json (that one might actually exist) and any other mimetypes you are interested in.
There is also the Media Viewers add-on which was for older releases but it will show how to configure web previews by mimetype.