Skip to content

Automatic versioning of endpoint API  #1711

Open

Description

@lukehutch

Is your feature request related to a problem? Please describe.

I am trying to figure out how to properly version my server API, so that my app refuses to connect to the server if the app version is to old to work with the server API.

Describe the solution you'd like

I would like serverpod generate to alert the user when the generated code breaks the API in a non-backwards-compatible way (removing a method or parameter, adding a required parameter, or changing the type of a parameter). (Changes that do not break backwards compatibility include things like adding a method or optional named parameter.)

Then, if serverpod generate indicates that the server API has changed, the user can opt to update the server API version number using another serverpod_cli command (this should probably be done manually so that experimental or accidental changes to the API don't bump the API level).

Then on the client, initializing the SessionManager, an error will result if the client tries to connect to a server with an incompatible API.

Describe alternatives you've considered

I can version the API manually, and have the client ask the server for its API level, before deciding whether to allow the user to use the app or not. However, this would be prone to breakage.

Activity

  1. added
    enhancement
    on Jan 8, 2024
  2. SandPod commented on Mar 26, 2024

    @SandPod
    Contributor

    More thoughts on the topic: #2052

  3. added
    area: endpoints
    on Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: endpointsenhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions