Skip to content

Draft: feat(wip): add possible-relation-targets endpoint

Related to cubicweb/cubicweb#831

Adds an endpoint available at API_BASE_URL/possible-relation-targets to fetch all the possible entities as target of a relation.

Works for both subject and object relations. The user sends the source entity type, the wanted targets, and the relation type. This relation type may include the reverse_ keyword to consider the source as object of the relation instead of subject.

If an eid is supplied, the endpoint will consider it for possible constraints. Users can also send known values with the known_values param to still compute constraints when creating a new entity (eg: you create a museum from a city, so you already know in which city that museum is even if it is not created yet).


  • Unit tests
  • Documentation
  • Pagination (may leave this for another MR)
Edited by Arnaud Vergnet

Merge request reports