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 has been 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.
The text was updated successfully, but these errors were encountered:
Lets say I have a model which has a field expected as link.
Model:
When fetching Foo resource hal-parser spits out
bar
field asHalResorce
not asBar
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 castingBar
field toHalResource
.The text was updated successfully, but these errors were encountered: