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
`
@JsonApiResource(type = "superTasks", subTypes = SpecialTask.class)
public abstract class SuperTask {
@JsonApiId
private Long id;
private String name;
private String category;
}
@JsonApiResource(type = "specialTask", resourcePath = "superTasks")
public class SpecialTask extends SuperTask {
private boolean recurring;
private String end;
}
`
Getters and setters have been omitted for brevity.
Requesting path superTasks with request parameter, we get :
✔️ fields[specialTask]=name returns json including only attribute name.
✔️ fields[specialTask]=end returns json including only attribute end.
✔️ fields[specialTask]=name,end returns json including only attributes name and end.
❎ fields[superTasks]=namereturns json including all attributes (from SpecialTask and SuperTask).
❎ fields[superTasks]=name and fields[specialTask]=end returns json including only attribute end.
Expected responses :
✔️ fields[specialTask]=name returns json including only attribute name.
✔️ fields[specialTask]=end returns json including only attribute end.
✔️ fields[specialTask]=name,end returns json including only attributes name and end.
✔️ fields[superTasks]=name returns json including only attribute name.
✔️ fields[superTasks]=name and fields[specialTask]=end returns json including only attributes name and end.
At the moment, introducing a new type in the hierarchy (a sibling for SpecialTask) creates a breaking change for our customers, because we need them to specifiy fields for all sub-types.
The text was updated successfully, but these errors were encountered:
When using request parameter field, if specifying a super type of the resource requested, the parameter is not taken into account.
Let's define two resources, SuperTask and SpecialTask, the latter inheriting the former, using a single repository per type hierarchy (as stated here : https://www.crnk.io/releases/stable/documentation/#_inheritance) :
`
@JsonApiResource(type = "superTasks", subTypes = SpecialTask.class)
public abstract class SuperTask {
}
@JsonApiResource(type = "specialTask", resourcePath = "superTasks")
public class SpecialTask extends SuperTask {
}
`
Getters and setters have been omitted for brevity.
Requesting path superTasks with request parameter, we get :
fields[specialTask]=name
returns json including only attributename
.fields[specialTask]=end
returns json including only attributeend
.fields[specialTask]=name,end
returns json including only attributesname
andend
.fields[superTasks]=name
returns json including all attributes (from SpecialTask and SuperTask).fields[superTasks]=name
andfields[specialTask]=end
returns json including only attributeend
.Expected responses :
fields[specialTask]=name
returns json including only attributename
.fields[specialTask]=end
returns json including only attributeend
.fields[specialTask]=name,end
returns json including only attributesname
andend
.fields[superTasks]=name
returns json including only attributename
.fields[superTasks]=name
andfields[specialTask]=end
returns json including only attributesname
andend
.At the moment, introducing a new type in the hierarchy (a sibling for SpecialTask) creates a breaking change for our customers, because we need them to specifiy fields for all sub-types.
The text was updated successfully, but these errors were encountered: