crnk-project / crnk-framework

JSON API library for Java
Apache License 2.0
286 stars 153 forks source link

Client: ClassCastException on cardinality mismatch #876

Open chrylis opened 1 year ago

chrylis commented 1 year ago

If a relation is listed in the resource class as single-cardinality, but the server returns an array, Crnk triggers a ClassCastException in ResourceUpsert#setRelationFieldAsync:361 (in 3.4) because it assumes that the value will be a ResourceIdentifier. Ideally, Crnk should be lenient and accept what the server sent; at the very least, it should produce a meaningful error message instead.