Unless even empty actions is provided, output is an empty JSON
E.g. this works:
const representor = require('representor-serializer');
response.data = {};
response.data.someAttribute = someValue;
response.actions = [];
// Convert internal representation to HAL
response = representor(response, 'application/hal+json');
But when removing empty .actions code returns an empty object:
const representor = require('representor-serializer');
response.data = {};
response.data.someAttribute = someValue;
// Convert internal representation to HAL
response = representor(response, 'application/hal+json');
return {}
The two should produce identical output
Unless even empty
actionsis provided, output is an empty JSONE.g. this works:
But when removing empty
.actionscode returns an empty object:return
{}The two should produce identical output