Files
gh-jeremylongshore-claude-c…/skills/skill-adapter/assets/migration_guide_template.md
2025-11-29 18:52:42 +08:00

122 lines
6.1 KiB
Markdown

# API Migration Guide: [API Name] - Version [Old Version] to Version [New Version]
This document outlines the necessary steps to migrate your application from version [Old Version] to version [New Version] of the [API Name] API. Carefully review these instructions to ensure a smooth and successful transition.
## Introduction
This migration guide provides a detailed overview of the changes introduced in version [New Version] of the [API Name] API and offers step-by-step instructions on how to adapt your application accordingly. We strive to minimize disruption during the upgrade process while introducing new features and improvements.
**Key Changes in Version [New Version]:**
* [Briefly describe key change 1, e.g., New authentication method using OAuth 2.0]
* [Briefly describe key change 2, e.g., Updated response format for the `/users` endpoint]
* [Briefly describe key change 3, e.g., Removal of the `/legacy-endpoint` endpoint]
**Impact:**
[Summarize the overall impact of the changes on existing applications. Will it require significant code changes? Is it mostly additive?]
## Deprecation Notices
The following features or endpoints have been deprecated in version [New Version]:
* **Endpoint:** `/legacy-endpoint` - Use `/new-endpoint` instead. (See "Migration Steps" below)
* **Parameter:** `old_parameter` in `/resource` - Use `new_parameter` instead. This parameter will be removed in version [Future Version].
We strongly recommend migrating away from these deprecated features as soon as possible to avoid future compatibility issues.
## Migration Steps
This section provides detailed instructions on migrating your application to the new version. Follow these steps in order to ensure a successful upgrade.
**1. Update API Client:**
* If you're using a specific API client library, update it to the latest version compatible with version [New Version]. Refer to the client library's documentation for specific upgrade instructions.
**2. Authentication Changes (if applicable):**
* **Old Method:** [Describe the old authentication method, e.g., API keys]
* **New Method:** [Describe the new authentication method, e.g., OAuth 2.0]
* **Action Required:** [Explain how to implement the new authentication method. Include example code snippets if possible. For example:
```
// Old: Using API Key
const apiKey = "[YOUR_API_KEY]";
const response = await fetch("/api/users", {
headers: { "X-API-Key": apiKey }
});
// New: Using OAuth 2.0 Token
const accessToken = await getAccessToken(); // Function to obtain access token
const response = await fetch("/api/users", {
headers: { "Authorization": `Bearer ${accessToken}` }
});
```
]
**3. Endpoint Changes:**
* **`/legacy-endpoint` to `/new-endpoint`:**
* **Old Endpoint:** `/legacy-endpoint`
* **New Endpoint:** `/new-endpoint`
* **Reason for Change:** [Explain why the endpoint was changed, e.g., Improved performance, better data model]
* **Action Required:** Update all calls to `/legacy-endpoint` to use `/new-endpoint`. Note that the response format may have changed. See the "Response Format Changes" section below.
**4. Request Parameter Changes:**
* **`old_parameter` to `new_parameter` in `/resource`:**
* **Old Parameter:** `old_parameter` (Description: [Brief description of the old parameter])
* **New Parameter:** `new_parameter` (Description: [Brief description of the new parameter])
* **Action Required:** Replace all instances of `old_parameter` with `new_parameter`. Ensure the data type is compatible. [Explain any data type conversions needed.]
**5. Response Format Changes:**
* **`/users` Endpoint:**
* **Old Response Format:**
```json
{
"user_id": "123",
"user_name": "John Doe"
}
```
* **New Response Format:**
```json
{
"id": "123",
"name": "John Doe",
"email": "john.doe@example.com"
}
```
* **Action Required:** Update your application to handle the new response format. Specifically, replace references to `user_id` with `id` and `user_name` with `name`. Also, consider utilizing the new `email` field.
**6. Error Handling:**
* The error codes and messages may have changed in version [New Version]. Consult the API documentation for a complete list of error codes and their meanings. [Provide examples of common error code changes].
**7. Testing:**
* Thoroughly test your application after migrating to version [New Version] to ensure that all functionality is working as expected. Pay particular attention to the areas affected by the changes outlined in this guide. Consider using automated testing tools to verify the compatibility of your application with the new API version.
## Backward Compatibility
While we strive to maintain backward compatibility whenever possible, some changes were necessary in version [New Version]. The following aspects are **not** backward compatible:
* [List specific non-backward-compatible aspects, e.g., Authentication method]
* [List specific non-backward-compatible aspects, e.g., The `/legacy-endpoint` endpoint has been completely removed]
## Support and Resources
If you encounter any issues during the migration process, please consult the following resources:
* **API Documentation:** [Link to API documentation]
* **Support Forum:** [Link to support forum]
* **Contact Us:** [Email address or contact form link]
We are committed to providing you with the support you need to successfully migrate to version [New Version] of the [API Name] API.
## Versioning Policy
[Describe the API versioning policy - how long are old versions supported? How are deprecation notices handled? What is the upgrade schedule? Example: We support the current version and the previous two major versions. Deprecated features are announced at least 6 months prior to removal.]
## Conclusion
Migrating to version [New Version] of the [API Name] API will enable you to take advantage of the latest features and improvements. By following the steps outlined in this guide, you can ensure a smooth and successful transition. Thank you for using our API!