Customize rest api response levels (object vs id)

We use to have a setting autoPopulate which enables the population of every relational field by default. It might worth it to remove it and replace it with a more precise setting such as populate which could accept multiple values.

  • populate: all would have the same behavior as the autoPopulate by populating the first level of relational fields.

  • populate: ['category', 'category.tags'] would only populate the category field at the first level and the tags relational field at the second level.

  • populate: ['category', 'category.tags.name'] would only populate the category field at the first level, and the tags relational field at the second level by only returning the name of it.

IMO, it’s very close to an advanced query system that we could implement in the REST API. I don’t know what we have in mind regarding this and the v4 (cc @alexandrebodin)

1 Like