Versioning api endpoints2019 Community Moderator ElectionHow do I intercept a method call in C#?What are the correct version numbers for C#?Does IMDB provide an API?Sync Framework Version Upgrade QuestionWCF vs ASP.NET Web APIHow do I get ASP.NET Web API to return JSON instead of XML using Chrome?Versioning Web API actions in ASP.NET MVC 4Why not inherit from List<T>?Web API 2 routing not working after upgrading asp.net website to asp.net web appWeb API Routing with Versions

How do we objectively assess if a dialogue sounds unnatural or cringy?

I can't die. Who am I?

An Undercover Army

How can I be pwned if I'm not registered on the compromised site?

How can I conditionally format my HTML table?

Draw bounding region by list of points

The Ohm's law calculations of the parts do not agree with the whole

Why would the IRS ask for birth certificates or even audit a small tax return?

PTIJ: Mordechai mourning

How can I highlight parts in a screenshot

How to mitigate "bandwagon attacking" from players?

Did Amazon pay $0 in taxes last year?

Create chunks from an array

Book about a time-travel war fought by computers

Specific Chinese carabiner QA?

How to get the first element while continue streaming?

Where is this quote about overcoming the impossible said in "Interstellar"?

PTIJ: What dummy is the Gemara referring to?

Can the Shape Water Cantrip be used to manipulate blood?

Sometimes a banana is just a banana

It doesn't matter the side you see it

Can I become debt free or should I file for bankruptcy? How do I manage my debt and finances?

Why are special aircraft used for the carriers in the United States Navy?

When was drinking water recognized as crucial in marathon running?



Versioning api endpoints



2019 Community Moderator ElectionHow do I intercept a method call in C#?What are the correct version numbers for C#?Does IMDB provide an API?Sync Framework Version Upgrade QuestionWCF vs ASP.NET Web APIHow do I get ASP.NET Web API to return JSON instead of XML using Chrome?Versioning Web API actions in ASP.NET MVC 4Why not inherit from List<T>?Web API 2 routing not working after upgrading asp.net website to asp.net web appWeb API Routing with Versions










1















Im working with an API that needs versioning. For now, Im doing like this:



namespace MixApi.UI.Controllers

[ApiVersion("1.0")]
public class VoController : ApiController

[Route("api/vversion:apiVersion/vo/order/")]
public IHttpActionResult Method1()



namespace MixApi.UI.Controllers.v2

[ApiVersion("2.0")]
public class VoController : ApiController

[Route("api/vversion:apiVersion/vo/order/")]
public IHttpActionResult Method1() // Improved this with new logic

[Route("api/vversion:apiVersion/vo/order2/")]
public IHttpActionResult Method2() // New method for v2




However. Let's say that Im going to add a new controller, let's say ArticleController. How should I version It? Should It be v1 or v2?



Im thinking It should be v1, because It's the first version of that controller/endpoint. But then I realize that I'm versioning the controller(the endpoint), and not the API itself. So I get a little bit confused of how I should do the versioning in this case.



How do you guys do it?










share|improve this question




























    1















    Im working with an API that needs versioning. For now, Im doing like this:



    namespace MixApi.UI.Controllers

    [ApiVersion("1.0")]
    public class VoController : ApiController

    [Route("api/vversion:apiVersion/vo/order/")]
    public IHttpActionResult Method1()



    namespace MixApi.UI.Controllers.v2

    [ApiVersion("2.0")]
    public class VoController : ApiController

    [Route("api/vversion:apiVersion/vo/order/")]
    public IHttpActionResult Method1() // Improved this with new logic

    [Route("api/vversion:apiVersion/vo/order2/")]
    public IHttpActionResult Method2() // New method for v2




    However. Let's say that Im going to add a new controller, let's say ArticleController. How should I version It? Should It be v1 or v2?



    Im thinking It should be v1, because It's the first version of that controller/endpoint. But then I realize that I'm versioning the controller(the endpoint), and not the API itself. So I get a little bit confused of how I should do the versioning in this case.



    How do you guys do it?










    share|improve this question


























      1












      1








      1








      Im working with an API that needs versioning. For now, Im doing like this:



      namespace MixApi.UI.Controllers

      [ApiVersion("1.0")]
      public class VoController : ApiController

      [Route("api/vversion:apiVersion/vo/order/")]
      public IHttpActionResult Method1()



      namespace MixApi.UI.Controllers.v2

      [ApiVersion("2.0")]
      public class VoController : ApiController

      [Route("api/vversion:apiVersion/vo/order/")]
      public IHttpActionResult Method1() // Improved this with new logic

      [Route("api/vversion:apiVersion/vo/order2/")]
      public IHttpActionResult Method2() // New method for v2




      However. Let's say that Im going to add a new controller, let's say ArticleController. How should I version It? Should It be v1 or v2?



      Im thinking It should be v1, because It's the first version of that controller/endpoint. But then I realize that I'm versioning the controller(the endpoint), and not the API itself. So I get a little bit confused of how I should do the versioning in this case.



      How do you guys do it?










      share|improve this question
















      Im working with an API that needs versioning. For now, Im doing like this:



      namespace MixApi.UI.Controllers

      [ApiVersion("1.0")]
      public class VoController : ApiController

      [Route("api/vversion:apiVersion/vo/order/")]
      public IHttpActionResult Method1()



      namespace MixApi.UI.Controllers.v2

      [ApiVersion("2.0")]
      public class VoController : ApiController

      [Route("api/vversion:apiVersion/vo/order/")]
      public IHttpActionResult Method1() // Improved this with new logic

      [Route("api/vversion:apiVersion/vo/order2/")]
      public IHttpActionResult Method2() // New method for v2




      However. Let's say that Im going to add a new controller, let's say ArticleController. How should I version It? Should It be v1 or v2?



      Im thinking It should be v1, because It's the first version of that controller/endpoint. But then I realize that I'm versioning the controller(the endpoint), and not the API itself. So I get a little bit confused of how I should do the versioning in this case.



      How do you guys do it?







      c# asp.net-web-api






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 20 hours ago









      Panagiotis Kanavos

      55.9k483112




      55.9k483112










      asked 20 hours ago









      BryanBryan

      1,07352036




      1,07352036






















          2 Answers
          2






          active

          oldest

          votes


















          1














          You can assign multiple version to a controller and in your case I may consider doing this so if you are on version 2 and come out with a brand new controller you can assign it either one version or both.



          [Authorize]
          [ApiVersion("3.0")]
          [ApiVersion("2.0")]
          [Route("api/vversion:apiVersion/Users")]


          I do think that version should be viewed as complete products, so a user will use version 2 as it's the latest (for example) but all of a sudden they must reference version 1 just for a new feature. could cause confusion and doesn't seem to client friendly






          share|improve this answer






























            0














            It is best to do Versioning on Project Level. There are many versioning guides available which you can follow. I would like to slip in a reference to Semantic Versioning Guidelines here https://semver.org/



            This ensures stability of the dependent applications.




            However. Let's say that Im going to add a new controller, let's say ArticleController. How should I version It? Should It be v1 or v2?




            You should release the first stable version of your application. And then, follow a versioning process.
            So First Stable version would be v1.0.0 and a revision like adding a controller would be released as v1.0.1.
            A major change in a module, or section of your app (like code optimization, implementing a new technique etc) should be released as v1.1.x




            How do you guys do it?




            At my organization, we increment the main version number each year. For example, in 2018 v2.0.x, in 2019, v3.0.x and so on. For a major module level release, we will increment it from v2.0.1 to v2.1.1. If just a controller was added, we will change it from v2.1.1 to v2.1.2.
            You can also refer to releases page for an Open-Source project for reference (an example: https://wiki.ubuntu.com/Releases)






            share|improve this answer






















              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021561%2fversioning-api-endpoints%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              You can assign multiple version to a controller and in your case I may consider doing this so if you are on version 2 and come out with a brand new controller you can assign it either one version or both.



              [Authorize]
              [ApiVersion("3.0")]
              [ApiVersion("2.0")]
              [Route("api/vversion:apiVersion/Users")]


              I do think that version should be viewed as complete products, so a user will use version 2 as it's the latest (for example) but all of a sudden they must reference version 1 just for a new feature. could cause confusion and doesn't seem to client friendly






              share|improve this answer



























                1














                You can assign multiple version to a controller and in your case I may consider doing this so if you are on version 2 and come out with a brand new controller you can assign it either one version or both.



                [Authorize]
                [ApiVersion("3.0")]
                [ApiVersion("2.0")]
                [Route("api/vversion:apiVersion/Users")]


                I do think that version should be viewed as complete products, so a user will use version 2 as it's the latest (for example) but all of a sudden they must reference version 1 just for a new feature. could cause confusion and doesn't seem to client friendly






                share|improve this answer

























                  1












                  1








                  1







                  You can assign multiple version to a controller and in your case I may consider doing this so if you are on version 2 and come out with a brand new controller you can assign it either one version or both.



                  [Authorize]
                  [ApiVersion("3.0")]
                  [ApiVersion("2.0")]
                  [Route("api/vversion:apiVersion/Users")]


                  I do think that version should be viewed as complete products, so a user will use version 2 as it's the latest (for example) but all of a sudden they must reference version 1 just for a new feature. could cause confusion and doesn't seem to client friendly






                  share|improve this answer













                  You can assign multiple version to a controller and in your case I may consider doing this so if you are on version 2 and come out with a brand new controller you can assign it either one version or both.



                  [Authorize]
                  [ApiVersion("3.0")]
                  [ApiVersion("2.0")]
                  [Route("api/vversion:apiVersion/Users")]


                  I do think that version should be viewed as complete products, so a user will use version 2 as it's the latest (for example) but all of a sudden they must reference version 1 just for a new feature. could cause confusion and doesn't seem to client friendly







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 19 hours ago









                  MikeMike

                  15415




                  15415























                      0














                      It is best to do Versioning on Project Level. There are many versioning guides available which you can follow. I would like to slip in a reference to Semantic Versioning Guidelines here https://semver.org/



                      This ensures stability of the dependent applications.




                      However. Let's say that Im going to add a new controller, let's say ArticleController. How should I version It? Should It be v1 or v2?




                      You should release the first stable version of your application. And then, follow a versioning process.
                      So First Stable version would be v1.0.0 and a revision like adding a controller would be released as v1.0.1.
                      A major change in a module, or section of your app (like code optimization, implementing a new technique etc) should be released as v1.1.x




                      How do you guys do it?




                      At my organization, we increment the main version number each year. For example, in 2018 v2.0.x, in 2019, v3.0.x and so on. For a major module level release, we will increment it from v2.0.1 to v2.1.1. If just a controller was added, we will change it from v2.1.1 to v2.1.2.
                      You can also refer to releases page for an Open-Source project for reference (an example: https://wiki.ubuntu.com/Releases)






                      share|improve this answer



























                        0














                        It is best to do Versioning on Project Level. There are many versioning guides available which you can follow. I would like to slip in a reference to Semantic Versioning Guidelines here https://semver.org/



                        This ensures stability of the dependent applications.




                        However. Let's say that Im going to add a new controller, let's say ArticleController. How should I version It? Should It be v1 or v2?




                        You should release the first stable version of your application. And then, follow a versioning process.
                        So First Stable version would be v1.0.0 and a revision like adding a controller would be released as v1.0.1.
                        A major change in a module, or section of your app (like code optimization, implementing a new technique etc) should be released as v1.1.x




                        How do you guys do it?




                        At my organization, we increment the main version number each year. For example, in 2018 v2.0.x, in 2019, v3.0.x and so on. For a major module level release, we will increment it from v2.0.1 to v2.1.1. If just a controller was added, we will change it from v2.1.1 to v2.1.2.
                        You can also refer to releases page for an Open-Source project for reference (an example: https://wiki.ubuntu.com/Releases)






                        share|improve this answer

























                          0












                          0








                          0







                          It is best to do Versioning on Project Level. There are many versioning guides available which you can follow. I would like to slip in a reference to Semantic Versioning Guidelines here https://semver.org/



                          This ensures stability of the dependent applications.




                          However. Let's say that Im going to add a new controller, let's say ArticleController. How should I version It? Should It be v1 or v2?




                          You should release the first stable version of your application. And then, follow a versioning process.
                          So First Stable version would be v1.0.0 and a revision like adding a controller would be released as v1.0.1.
                          A major change in a module, or section of your app (like code optimization, implementing a new technique etc) should be released as v1.1.x




                          How do you guys do it?




                          At my organization, we increment the main version number each year. For example, in 2018 v2.0.x, in 2019, v3.0.x and so on. For a major module level release, we will increment it from v2.0.1 to v2.1.1. If just a controller was added, we will change it from v2.1.1 to v2.1.2.
                          You can also refer to releases page for an Open-Source project for reference (an example: https://wiki.ubuntu.com/Releases)






                          share|improve this answer













                          It is best to do Versioning on Project Level. There are many versioning guides available which you can follow. I would like to slip in a reference to Semantic Versioning Guidelines here https://semver.org/



                          This ensures stability of the dependent applications.




                          However. Let's say that Im going to add a new controller, let's say ArticleController. How should I version It? Should It be v1 or v2?




                          You should release the first stable version of your application. And then, follow a versioning process.
                          So First Stable version would be v1.0.0 and a revision like adding a controller would be released as v1.0.1.
                          A major change in a module, or section of your app (like code optimization, implementing a new technique etc) should be released as v1.1.x




                          How do you guys do it?




                          At my organization, we increment the main version number each year. For example, in 2018 v2.0.x, in 2019, v3.0.x and so on. For a major module level release, we will increment it from v2.0.1 to v2.1.1. If just a controller was added, we will change it from v2.1.1 to v2.1.2.
                          You can also refer to releases page for an Open-Source project for reference (an example: https://wiki.ubuntu.com/Releases)







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 17 hours ago









                          retr0retr0

                          11710




                          11710



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55021561%2fversioning-api-endpoints%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

                              Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                              2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived