Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
We Distribute
  1. Home
  2. General Discussion
  3. On a fediverse server with a versioned client API, what would you expect to happen if an API call is made with a version number higher than what the server supports?

On a fediverse server with a versioned client API, what would you expect to happen if an API call is made with a version number higher than what the server supports?

Scheduled Pinned Locked Moved General Discussion
smithereenactivitypubmastodev
8 Posts 6 Posters 279 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • grishka@mastodon.socialG This user is from outside of this forum
    grishka@mastodon.socialG This user is from outside of this forum
    grishka@mastodon.social
    wrote on last edited by
    #1

    On a fediverse server with a versioned client API, what would you expect to happen if an API call is made with a version number higher than what the server supports? Should it return an error? Should it take it to mean its highest supported version? Something else?

    The API isn't RESTful, the version number is global for all methods (endpoints) and has the format "major.minor".

    #Smithereen #ActivityPub #mastodev

    mro@digitalcourage.socialM nikclayton@mastodon.socialN rimu@piefed.socialR 3 Replies Last reply
    0
    • grishka@mastodon.socialG grishka@mastodon.social

      On a fediverse server with a versioned client API, what would you expect to happen if an API call is made with a version number higher than what the server supports? Should it return an error? Should it take it to mean its highest supported version? Something else?

      The API isn't RESTful, the version number is global for all methods (endpoints) and has the format "major.minor".

      #Smithereen #ActivityPub #mastodev

      mro@digitalcourage.socialM This user is from outside of this forum
      mro@digitalcourage.socialM This user is from outside of this forum
      mro@digitalcourage.social
      wrote on last edited by
      #2

      Hi @grishka,
      using highest sounds like best effort and makes most sense to me.

      grishka@mastodon.socialG 1 Reply Last reply
      0
      • mro@digitalcourage.socialM mro@digitalcourage.social

        Hi @grishka,
        using highest sounds like best effort and makes most sense to me.

        grishka@mastodon.socialG This user is from outside of this forum
        grishka@mastodon.socialG This user is from outside of this forum
        grishka@mastodon.social
        wrote on last edited by
        #3

        @mro but what if there are incompatible changes that the app doesn't expect? Like some object having a different format, or some method behaving differently

        1 Reply Last reply
        0
        • grishka@mastodon.socialG grishka@mastodon.social

          On a fediverse server with a versioned client API, what would you expect to happen if an API call is made with a version number higher than what the server supports? Should it return an error? Should it take it to mean its highest supported version? Something else?

          The API isn't RESTful, the version number is global for all methods (endpoints) and has the format "major.minor".

          #Smithereen #ActivityPub #mastodev

          nikclayton@mastodon.socialN This user is from outside of this forum
          nikclayton@mastodon.socialN This user is from outside of this forum
          nikclayton@mastodon.social
          wrote on last edited by
          #4

          @grishka Return an error that tells the client it's used an unsupported version.

          By definition, the server does not know the semantics of the call the client made, so trying to guess and return something in the hope it's correct takes us out of the realm of engineering and into clairvoyance.

          julian@activitypub.spaceJ 1 Reply Last reply
          0
          • nikclayton@mastodon.socialN nikclayton@mastodon.social

            @grishka Return an error that tells the client it's used an unsupported version.

            By definition, the server does not know the semantics of the call the client made, so trying to guess and return something in the hope it's correct takes us out of the realm of engineering and into clairvoyance.

            julian@activitypub.spaceJ This user is from outside of this forum
            julian@activitypub.spaceJ This user is from outside of this forum
            julian@activitypub.space
            wrote on last edited by
            #5

            nikclayton@mastodon.social agreed.

            It's one thing for a server with a newer API version to be backwards compatible with a request from an older version, but it's impossible to predict the future and handle requests from a newer API client.

            Bouncing an error back would be the safest choice.

            cc grishka@mastodon.social

            1 Reply Last reply
            0
            • grishka@mastodon.socialG grishka@mastodon.social

              On a fediverse server with a versioned client API, what would you expect to happen if an API call is made with a version number higher than what the server supports? Should it return an error? Should it take it to mean its highest supported version? Something else?

              The API isn't RESTful, the version number is global for all methods (endpoints) and has the format "major.minor".

              #Smithereen #ActivityPub #mastodev

              rimu@piefed.socialR This user is from outside of this forum
              rimu@piefed.socialR This user is from outside of this forum
              rimu@piefed.social
              wrote on last edited by
              #6

              Isn't the convention to put the version in the url? e.g. /api/v3/site

              In which case a too-high version gives you a 404 error.

              grishka@mastodon.socialG 1 Reply Last reply
              0
              • rimu@piefed.socialR rimu@piefed.social

                Isn't the convention to put the version in the url? e.g. /api/v3/site

                In which case a too-high version gives you a 404 error.

                grishka@mastodon.socialG This user is from outside of this forum
                grishka@mastodon.socialG This user is from outside of this forum
                grishka@mastodon.social
                wrote on last edited by
                #7

                @rimu that's for RESTful APIs, mine isn't that because I dislike the concept. I just take the version as the `v` parameter

                trwnh@mastodon.socialT 1 Reply Last reply
                0
                • grishka@mastodon.socialG grishka@mastodon.social

                  @rimu that's for RESTful APIs, mine isn't that because I dislike the concept. I just take the version as the `v` parameter

                  trwnh@mastodon.socialT This user is from outside of this forum
                  trwnh@mastodon.socialT This user is from outside of this forum
                  trwnh@mastodon.social
                  wrote on last edited by
                  #8

                  @grishka @rimu putting the version in the uri is an older convention and not necessarily a REST(ful) thing either. what i've seen is to use content negotiation via an Accept-Version header

                  basically if you use conneg then 405 Not Acceptable; if you put versions in uris then 404 Not Found; if you take some parameter or payload then i guess maybe 422 Unprocessable Entity?

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  Powered by NodeBB Contributors
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups