Allow users to version the endpoints

Created on 22 June 2023, over 1 year ago
Updated 23 June 2023, over 1 year ago

First off, I think this is a long time coming in Drupal's API implementation.

Problem/Motivation

When creating APIs it is common practice to version an endpoint so that non-backwards compatible changes can be made without breaking existing clients. Currently any change to the display might result in existing clients breaking.

Steps to reproduce

Implement a display
Implement a client
Change the display
Notice that the client is also broken

Proposed resolution

Add another marker to the url pattern.

Before:
ejson/node/id

After: (recommended)
ejson/node/v1/id

Or:
ejson/v1/node/id

We can keep backwards compatibility as it is by allowing the setting of a default that can still be found at ejson/node/id

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

✨ Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States frob US

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @frob
  • Status changed to Fixed over 1 year ago
  • πŸ‡΅πŸ‡ΉPortugal rfmarcelino

    Hi @frob,
    Thank you for your contribution.
    Instead of making the route more verbose, I just added the apiVersion to the end of the response.
    I know it's not the same, but since this is the only version, I prefer to keep it cleaner.
    With this key, it's possible to make the verification on the client side.
    Please be aware that this module is very recent and is expected to get changes often.

  • Status changed to Fixed over 1 year ago
Production build 0.71.5 2024