Handle display JSON API version support

This commit is contained in:
Aurélien Georget 2016-02-01 14:38:55 +01:00
parent 348428132c
commit 3d0f801b3a

View File

@ -123,6 +123,15 @@ module.exports = {
break;
}
// Display JSON API version support
if (_.isPlainObject(strapi.config.jsonapi) && strapi.config.jsonapi.hasOwnProperty('showVersion') && strapi.config.jsonapi.showVersion === true) {
return _.assign(new JSONAPISerializer(type, value, toSerialize), {
jsonapi: {
version: '1.0'
}
});
}
return new JSONAPISerializer(type, value, toSerialize);
},