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
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
add a comment |
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
add a comment |
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
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
c# asp.net-web-api
edited 20 hours ago
Panagiotis Kanavos
55.9k483112
55.9k483112
asked 20 hours ago
BryanBryan
1,07352036
1,07352036
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
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
add a comment |
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)
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
answered 19 hours ago
MikeMike
15415
15415
add a comment |
add a comment |
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)
add a comment |
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)
add a comment |
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)
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)
answered 17 hours ago
retr0retr0
11710
11710
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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