The extension has nothing to do with anything. However, some web hosting providers are smart enough to assume that a ".json" file applies to a Content-Type of application/json, and serve the content with that Content-Type.
What's important is the HTTP Content-Type header returned by the server. It appears that Direct Publisher is looking for a specific Content-Type header of application/json, for example.
I don't know anything about Amazon S3, but when researching this problem trying search for
"Content-Type" http header (sometimes also referred to as a mime-type). Look for a way you can specify a specific Content-Type for a particular file or file extension, either from a control panel or settings value, or some other url that will serve the same content with a different Content-Type. You'd probably get better help on StackOverflow under the 'amazon-web-services' and 'amazon-s3' tags.
https://github.com/belltown/