You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 7, 2021. It is now read-only.
Lets say I have a model which has a field expected as link.
Model:
export class Foo extends HalResource {
@HalProperty('response.bar')
bar: Bar; // it's link
}
When fetching Foo resource hal-parser spits out bar field as HalResorce not as Bar which is incorrect behavior. After some debugging I found that library passes to method Reflect.getMetadata link key as it is from hal json (e.g. 'response.bar') but MetadataMap contains field names and appropriate constructors in format that is specified in @HalProperty() decorator (e.g. 'bar'). Apparently proper constructor cannot be found by incorrect key and that leads to casting Bar field to HalResource.
Lets say I have a model which has a field expected as link.
Model:
When fetching Foo resource hal-parser spits out
barfield asHalResorcenot asBarwhich is incorrect behavior. After some debugging I found that library passes to method Reflect.getMetadata link key as it is from hal json (e.g.'response.bar') but MetadataMap contains field names and appropriate constructors in format that is specified in@HalProperty()decorator (e.g.'bar'). Apparently proper constructor cannot be found by incorrect key and that leads to castingBarfield toHalResource.