olosegres/jsona

Meta support

dlq84 opened this issue · 8 comments

dlq84 commented

Hi, it would be great if this lib could support meta information. As it is now that information is just ignored during deserialization

http://jsonapi.org/format/#document-meta

@dlq84 Hi, what kind of support do you mean? Add argument to pass meta to serialize?

dlq84 commented

I think it's only relevant during deserialization, ie the server API is the party that is adding such information.

So basically have a setMeta() in the IJsonPropertiesMapper so it can be implemented in the user implemented property mapper and maybe even in the default JsonPropertiesMapper

EDIT: something like this basically: qoorp@8717cfa

Regards

@dlq84 Ok, I'll merge it with some additions soon

@olosegres Hi, was this one merged? I'm struggling with getting meta information while deserialising.

@dlq84 @anjalirana @ggagosh
Hi!

It has been merged, available since version 1.1.6, sorry for delay

p.s. It's not cover support meta in relationship object http://jsonapi.org/format/#document-resource-object-relationships tell me if you need it

@olosegres Can we have the same implementation for data.links?
http://jsonapi.org/format/#document-links

setLinks(model: TJsonaModel, meta: TAnyKeyValueObject): void;
if (data.links) {
  this.pm.setLinks(model, data.links);
}

Thanks!

@aganov
Added in 1.1.8

@dlq84 @anjalirana @ggagosh

Support of meta in relationship object added in 1.1.8 too