Skip to content

Feature: using an alias column as identifier for endpoints #23

@Moongazer

Description

@Moongazer

Don't know how difficult this is, but creating an alias for certain endpoints could be a useful core feature. As example:

Lets say we have endpoints for pages or custom products-records. Instead of requesting /pages/123 or /products/987, it would be useful if e.g. the slug attribute of the records could be used as alias for ID.

Reason: currently, if a front-end wants to use SEO friendly URLs like /show/demo-item, it has to query for all products, loop through the result array, find the record matching demo-item, get the corresponding ID and request the API again to get the product details (the mapping happens on front-end side).

Maybe a TypeConverter can be used (see here and here) or the ID field can be selected with a condition:

IF {alias} is not empty THAN query by {alias} == {id}
ELSE query by uid == {id} (current implementation)
     itemOperations={
          "get"={
              "method"="GET",
              "path"="/pages/{id}",
              "alias"="slug",
          },
     },

Not sure if a REST API should be made for such things in general, please see it only as suggestion, discussion welcomed :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions