Validate json/yaml assets prior to loading in AEM 6.5
Hello, I need to validate json/yaml files prior to loading it to the assets in AEM 6.5, if the file is not valid than show an error to the author, if it is valid than just upload it. Right now I am trying to overlay and customize the upload.js file which is meant for handle the "Upload" button, if the file is in the myproject folder and it is json/yaml, then send it to the servlet for validation. Is it ok? Is there a better approach?