You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/src/content/docs/docs/howtos/Versioning/01-about-versioning.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,6 @@ title: Introduction
3
3
llmstxt: true
4
4
---
5
5
6
-
See [`@typespec/versioning` documentation](https://typespec.io/docs/libraries/versioning/guide) for the general versioning concept. This guide expands on how Azure Services should define and manage API versions.
7
-
8
-
See [Evolving APIs using the Versioning Library](./06-evolving-apis.md) for how to make specific kinds of common API changes in your specs.
9
-
10
6
## How Versioning Works in TypeSpec
11
7
12
8
TypeSpec uses a versioning library that models the changes in each new version of the API, rather than having a separate API description for each api-version. This works well when APIs evolve according to versioning guidelines, without breaking changes. For the most part, this means that this system is very good at modeling differences between stable api-versions for Azure APIs, but can be cumbersome when describing differences between preview APIs.
@@ -28,11 +24,11 @@ These documents add specific guidance about how to follow these guidelines for s
28
24
-[How to add a new preview version when the last version was stable](./04-preview-after-stable.md)
29
25
-[How to add a new stable version when the last version was stable](./05-stable-after-stable.md)
30
26
31
-
This document describes how to convert an existing multi-API TypeSpec spec with multiple previews into a spec with a single active preview. Note that this is not required, but it may significantly simplify the versioning decoration in your spec:
27
+
The following document describes how to convert an existing multi-API TypeSpec spec with multiple previews into a spec with a single active preview. Note that this is not required, but it may significantly simplify the versioning decoration in your spec:
32
28
33
29
-[How to convert a spec with multiple preview versions into a spec with a single active preview](./uncommon-scenarios/01-converting-specs.md)
34
30
35
-
###Uncommon Scenarios
31
+
## Uncommon Scenarios
36
32
37
33
Additionally, there are some (ARM) services that may always have features that remain in preview after a stable version is released. This can happen, for example, if there are multiple independent teams that own different resources in a service and operate on their own schedule. The recommended way to handle this scenario is to model your ARM ResourceProvider as multiple services, so each sub-service and the corresponding SDKs can version independently. For some older services, this is not an option, so there is specialized guidance on how to maintain preview features over stable API releases (described below). If you are thinking about splitting your service, or about creating a new preview version with every stable version, be sure to have a discussion with the [Azure API Stewardship Board](https://aka.ms/azapi/officehours) and the [Azure SDK team](https://eng.ms/docs/products/azure-developer-experience/onboard) first.
38
34
@@ -54,3 +50,8 @@ It is safe to remove the swagger for an old API version if any of the following
54
50
- The OpenAPI document in the azure-rest-api-specs repo is not needed for ARM registration
55
51
56
52
It is recommended that preview api-versions are set for retirement within 90 days when a preview or stable API is introduced. See the [Azure Retirement Policy](https://aka.ms/AzureRetirementPolicy) and [Azure Retirement Process](https://aka.ms/cpexretirementsprocess) for details.
53
+
54
+
## Additional Information on TypeSpec Versioning
55
+
56
+
-[`@typespec/versioning` documentation](https://typespec.io/docs/libraries/versioning/guide) for the general versioning concept.
57
+
-[Evolving APIs using the Versioning Library](./06-evolving-apis.md) for how to make specific kinds of common API changes in your specs.
Copy file name to clipboardExpand all lines: website/src/content/docs/docs/howtos/Versioning/06-evolving-apis.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,8 @@ After defining your enum, link it to your namespace using the `@versioned` decor
40
40
namespace Microsoft.ContosoProviderHub;
41
41
```
42
42
43
+
> **Note:** Add dependencies and common types for each version. After defining a new version, the emitter will produce outputs for all versions. You can then adapt your TypeSpec code for the latest version.
44
+
43
45
**Data-plane example:**
44
46
45
47
```tsp
@@ -53,8 +55,6 @@ enum Versions {
53
55
namespace DemoService;
54
56
```
55
57
56
-
> **Note:** Add dependencies and common types for each version. After defining a new version, the emitter will produce outputs for all versions. You can then adapt your TypeSpec code for the latest version.
57
-
58
58
## Simple Scenarios
59
59
60
60
These examples show how to add models, operations, properties, and parameters in specific versions using TypeSpec versioning decorators.
0 commit comments