It looks like something is wrong with the association reverse lookup. Looking deeper, it seems to be that if one is using an aliased foreignKey then the association is not picked up and listed in $table->_associations. So this may be a deeper problem with Cake itself.
Given a
people
andenquiries
table:I wish to associate
enquiries.notary_id
toperson.id
as amanyToOne
. In order to do so, I have the following association on theEnquiriesTable
:This partly works – but the links provided via JSONAPI are not all valid:
links: self
is functionallinks: related
is broken; goes to a 404 with error: "No valid relationship found"It looks like something is wrong with the association reverse lookup. Looking deeper, it seems to be that if one is using an aliased foreignKey then the association is not picked up and listed in $table->_associations. So this may be a deeper problem with Cake itself.