Recently we had case when typo in atlassian-connect descriptor did work for us in development and in production, but it appeared it was ignored indeed finally.
Of course we should have used atlassian-connect-validator to verify descriptor, but we forgot.
Well, it’s like flight accident in Guam, everything seemed right (including no userKey or username anywhere), but Marketplace did not recognise our apiMirgations (with typo) gdpr: true flag, and we almost crashed GDPR readiness project.
So, I decided to add validation to atlassian-connect-express, but none of the three nodejs json schema validators I’ve found (jsonschema, schema-validator, ajv) seem to provide that level of diagnosability as atlassian-connect-validator does. In particular, nodejs validators does not produce warning about unrecognised apiMirgations attribute as atlassian-connect-validator does.
Thus, question is, can anybody help with the idea to have same validation in atlassian-connect-express, please?
May be, simply, there is REST API in atlassian-connect-validator app on heroku?
Or maybe, someone knows how to do same validation in nodejs?
Or maybe Jira could do this when installing app in development?
Any thoughts or comments?
Note, I tried the following in atlassian-connect-express/lib/index.js#Addon:
var ajv = new Ajv({schemaId: 'auto', allErrors: true});
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json'));
request.get('https://bitbucket.org/atlassian/connect-schemas/raw/master/jira-global-schema.json', function(err, res, schema) {
if (!err && res.statusCode == 200) {
var valid = ajv.validate(JSON.parse(schema), self.descriptor);
console.log('validate', valid, ajv.errors);
}
});
Thank you.