Browse Source

Merge pull request #23634 from abpframework/article-01

Fix formatting in API versioning article
pull/23638/head
sumeyye 1 year ago
committed by GitHub
parent
commit
013ca0a518
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 8
      docs/en/Community-Articles/2025-08-27-backcompat-rest-apis-ms-dotnet/article.md

8
docs/en/Community-Articles/2025-08-27-backcompat-rest-apis-ms-dotnet/article.md

@ -44,9 +44,9 @@ x-api-version: 2.0
Pros: Clean URLs; multiple reader support. Cons: Needs proxy/CDN rules. Pros: Clean URLs; multiple reader support. Cons: Needs proxy/CDN rules.
3) **Media Type** 3) **Media Type**
``` Accept: application/json;v=2 Accept: application/json;v=2
``` Pros: Semantically accurate. Cons: More complicated to test and implement. **Recommendation:** For the majority of teams, favor **URI segments**, with an optional **`x-api-version`** header for flexibility. Pros: Semantically accurate. <br> Cons: More complicated to test and implement. <br> **Recommendation:** For the majority of teams, favor **URI segments**, with an optional **`x-api-version`** header for flexibility.
### Quick Setup in ASP.NET Core (Asp.Versioning) ### Quick Setup in ASP.NET Core (Asp.Versioning)
```csharp ```csharp
@ -156,13 +156,13 @@ public async Task Orders_v1_contract_should_match_snapshot()
Swagger UI configuration by group name: Swagger UI configuration by group name:
```csharp ```csharp
```
app.UseSwagger(); app.UseSwagger();
app.UseSwaggerUI(c => app.UseSwaggerUI(c =>
{ {
c.SwaggerEndpoint("/swagger/v1/swagger.json", "API v1"); c.SwaggerEndpoint("/swagger/v1/swagger.json", "API v1");
c.SwaggerEndpoint("/swagger/v2/swagger.json", "API v2"); c.SwaggerEndpoint("/swagger/v2/swagger.json", "API v2");
}); ``` });
```
--- ---
## Conclusion ## Conclusion

Loading…
Cancel
Save