Skip to content

Add constants for release train / major version (and probably minor as well) #2001

Closed

Description

@dan-lind

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

Today we can get the current SDK API version by calling Stripe.API_VERSION
This is defined as a static final string, which resolves to something like 2025-04-30.basil

When comparing messages passed between different services that might be on different versions of the SDK, it's important to understand if they are on different release trains, since the versioning contract states that breaking changes are only introduced for new majors.

To get the release train/major version, we have to do something like
Stripe.API_VERSION.split("\\.", 2)[1]
It would be nice if Stripe provided constants for major/release train (and probably minor version as well)

Describe the solution you'd like

Add a new constants in Stripe.java
With Stripe.API_VERSION returning 2025-04-30.basil

Something like
Stripe.API_RELEASE_TRAIN which returns the release train/major version basil
or simply
Stripe.API_MAJOR_VERSION which returns basil and
Stripe.API_MINOR_VERSION which returns 2025-04-30
to avoid forcing users to do string parsing

Describe alternatives you've considered

No response

Additional context

No response

Activity

  1. xavdid-stripe commented on May 16, 2025

    @xavdid-stripe
    Contributor

    Hey @dan-lind! That's a great suggestion- we'll look into adding it soon.

  2. riken127 commented on Jul 22, 2026

    @riken127

    Hi! I checked the current implementation and noticed that the generated ApiVersion class already exposes CURRENT_MAJOR, although it is package-private and is not currently surfaced through the public Stripe API.

    Would you accept a PR exposing this value publicly through Stripe, for example as Stripe.API_VERSION_MAJOR or Stripe.API_RELEASE_TRAIN?

    I could also add tests ensuring that the public constant remains consistent with the generated ApiVersion.CURRENT_MAJOR. I would avoid introducing a separate date-version constant unless that is also desired.

  3. ArthurJiang628 commented on Jul 31, 2026

    @ArthurJiang628

    Hi I looked at this issue and I am very interested in dealing with it. Could you assign it to me? Thank you very much!

  4. xavdid commented on Jul 31, 2026

    @xavdid
    Member

    Ah, sorry about that! Small oversight on our part.

    And thanks for the interest from both of you. But given that we need to fix this across a bunch of SDKs, I've taken care of it myself (#2261). When that's merged, I'll close this out.

  5. xavdid commented on Aug 10, 2026

    @xavdid
    Member

    This was released in v33.3.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions