Replies: 1 comment
-
Out-of-the-box, the short answer is - no; however, there are many extensions to enable it. This type of solution is very specific to your application and cannot be easily genericized. API versions must be explicit, which is intrinsically why it isn't supported by default. The step is one of the biggest challenges. What should the step between versions be? A major version? A minor version? How about if the version is a date? There are several possible solutions, but there is no universal answer that suites everyone (or it would be baked in). There are a number of options presented in discussions and (closed) issues. At a high level, you have several options:
If all of your controllers are symmetrical and use the same set of versions, a custom convention (a la
|
Beta Was this translation helpful? Give feedback.
-
For the moment, we're using the following syntax to define which versions can be used by a controller.
But when a new version is added, how is it possible to make it accessible to all controllers without having to add a new
[ApiVersion(ApiVersions.V3_0)]
attribute to the top of all controllers?Is it possible to indicate the version from which a controller is available?
Examples
[ApiVersionRange(From: ApiVersions.V1_0)]
[ApiVersionRange(From: ApiVersions.V1_0, To: ApiVersions.V3_0)]
Beta Was this translation helpful? Give feedback.
All reactions