Fix JSON detection
Merge pull request #2775 from remicollet/issue-json

Fix JSON detection