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
Currently, a collection can contain members of a single type. The type of the first member overwrites others.
Let’s say we have a resource /cars/ which is a Collection of cars. There are 2 subtypes of cars in the Web API: sandero and audi. The representation sent back from GET /cars/ contains both a sandero and an audi (in this order). Currently, requesting the available operations on the audi will result in showing the sandero’s operations.
The reason is that the DOM layout is expected to contain 2 levels of spans (cf. line 246 element.parent().parent() in hydra.js) to return the right type associated with the selection. Arrays (which are used for collections), contrary to objects, have only one level of span around them.
A fix could consist simply in adding the additional required span level for arrays (line 300).
if(_.isArray(data)){result+='[<br>'+indent;for(i=0;i<data.length;i++){result+='<span>';// new lineresult+=' ';result+=this.renderResponse(data[i],indent+' ',(i===data.length-1));result+=indent;result+='</span>';// new line}result+=']';}
The text was updated successfully, but these errors were encountered:
Currently, a collection can contain members of a single type. The type of the first member overwrites others.
Let’s say we have a resource
/cars/
which is a Collection of cars. There are 2 subtypes of cars in the Web API: sandero and audi. The representation sent back fromGET /cars/
contains both a sandero and an audi (in this order). Currently, requesting the available operations on the audi will result in showing the sandero’s operations.The reason is that the DOM layout is expected to contain 2 levels of
span
s (cf. line 246element.parent().parent()
in hydra.js) to return the right type associated with the selection. Arrays (which are used for collections), contrary to objects, have only one level ofspan
around them.A fix could consist simply in adding the additional required span level for arrays (line 300).
The text was updated successfully, but these errors were encountered: