Hello,
We are developing a platform designed to collect data from several applications and we are using Parse to make the interface between the applications and the platform. Different classes of objects will be sent by the applications, and we want to use json-schema to validate them. Our problem is that the schema used by Parse is not compatible with json-schema, so we need to skip the validation made by Parse and implement the validation ourself.
For now we think of using a generic class in Parse named jsonSchemaData
which will contain the schema URL and the data json will be in the data field:
module.exports = {
className: "jsonSchemaData",
fields: {
schemaURL: {type: "String"},
data: {type: "Object"}
}
};
The validation will be done in the beforeSave
hook in Parse cloud code.
We wonder if we really need to do this complicated stuff. Ideally we would want to uses classes which do not use the Parse schema at all, so the only validation would be done by us in the cloud code and we could have different classes instead of using a generic one. Is there a way to do something like that?