我正在玩crnk,试图推断出我在文档中找不到的位。我将在标准crnk示例中解释我的问题:https://github.com/crnk-project/crnk-framework/tree/master/crnk-integration-examples/spring-boot-example。
项目与任务之间存在一对多的关系(其他资源无关)。如果我正确理解它(该示例使用显然不推荐使用的- (void)drawRect:(CGRect)frame {
[super drawRect:frame];
if (self.viewModel == nil) return;
NSAttributedString *string = [self.viewModel arabicStringWithTajweed];
CGRect originalRect = [self convertRect:self.arabicLabel.frame fromView:self.arabicLabel];
[string drawInRect:originalRect];
}
@JsonApiRelation参数),则关系的所有者为1Task.project1。我现在要列出按相关资源的某些属性过滤的资源。例如。这按预期工作(从响应中保留了一些不重要的位):
opposite
但是无法进行相反的过滤:
GET http://127.0.0.1:8080/api/tasks?filter[project.id]=121
{
"data" : [ {
"id" : "1","type" : "tasks","links" : {
"self" : "http://127.0.0.1:8080/api/tasks/1"
},"attributes" : {
"name" : "Create tasks","description" : null
},"relationships" : {
"project" : {
"data" : {
"id" : "121","type" : "projects"
}
}
} ]
}
这在资源设置下是否可以预期(请参见上面的链接)?如果是,必须做什么才能使过滤在两个方向上都能起作用?