/cars/{id}/rear-windows
instead of /cars/{id}/rearWindows
. While changing the resourcePath
field of the JsonApiResource
annotation works for top/root level, crnk.io apparently uses the variable name inside the CarResource
as path for the subresource.
domain-name
that's seen by CRNK, thus the self links have the wrong domain name? I am aware of the properties, but in this case it might be easier to configure an HTTP header, if possible.
/books?filter[author][EQ]=null
, JPA performs an SELECT * FROM books INNER JOIN author ON author.id IS NULL
, and this query will never return any results
Good day everyone,
I am trying to intercept the error response thrown by Crnk then add our custom error details. (e.g. if a resource is not found a 404 is thrown directly by Crnk without any details) Anyone has idea on how to intercept this error response then added a custom details?
Thank you in advance.
Hi
Is there anyway to make crnk accepts this url
/parents/{parentID}/childs/{ChildID}
I see in the documentation an example but I don't know how I can apply it if am using jpaentityrepository base
Parent class
@Data
@JsonApiResource(type = "parents")
@Entity
@Table(name = "parents")
public class Parent {
@Id
@JsonApiId
@GeneratedValue(generator = "UUID")
@GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator")
@Column(name = "id", updatable = false, nullable = false)
private UUID id;
@NotEmpty
private String name;
@JsonApiRelation(serialize = SerializeType.ONLY_ID)
@OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Child> childs;
}
Child class
@Data
@JsonApiResource(type = "childs")
@Entity
@Table(name = "childs")
public class Child {
@Id
@JsonApiId
@GeneratedValue(generator = "UUID")
@GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator")
@Column(name = "id", updatable = false, nullable = false)
private UUID id;
@ManyToOne
@JoinColumn(name = "parent_id", referencedColumnName = "id")
private Parent parent;
@NotEmpty(message = "koko")
private String value;
}
when I add nested = true to the child class
it throws an exception any help
Please advice
how can i setup nesting ? if the repo extends jpa entity repo ?
also I have another question
the parent model here has list<child> one to many relation ship
If i put the relationships id in the post request no effect will be done ?
if u do a get request of this model again the child relationship will be empty array not like what i did in the post request
like the following
{
"data":
{
"type":"parent",
"attributes":{
"name":"anything"
},
"relationships":{
"childs":{
"data":[{"id":"1","type":"child"}]
}
}
}
}
Hi,
we are using Java EE,crnk and Weblogic. We are having problems with generated links (self,relationship, next,prev, etc). When we go through load balancer or proxy, links aren't properly generated. For instance
[https://testEnvironment/_wsE122_model-info/ordering/orders?page[limit]=10] (link without load balancer) => generated links are okay
[https://loadBalancerLink/v1/model-info/ordering/orders?page[limit]=10] (link with load balancer/proxy) => generated links aren't proper, they are like this: [https://testEnvironment/_wsE122_model-info/ordering/orders...).
The problem is links aren't masked (generated) properly. We can't use X-Forward-Headers.. and we were unsuccessful overriding domain-name (crnk resource domain name).
Can you give us any possible solution for this (explain how exactly to override domain name or give us some other proposition of solution)?
Does crnk support using of "Referer" header (that would be great for us)?
Hi,
Just wanted to ask a quick question regarding validation of the include parameter and expected responses to the following:
I know for the first, it seems to ignore it.. But was expecting a BadRequest.
Are the unit tests for these ?
filter[person]=null
and various derivatives of that, but that doesn't seem to be working.
Resource-based authorization: Don't know where ?
Field-based authorization: Implementing ResourceFilter as Spring @Component?
Data-based authorization: Inside SecurityConfigurer.config.setDataRoomFilter?