aspnet-api-versioning icon indicating copy to clipboard operation
aspnet-api-versioning copied to clipboard

Add .http files for all API examples

Open Copilot opened this issue 3 months ago • 1 comments

Added standardized .http request files for all 20 API example projects to enable quick testing and exploration of versioning functionality.

Description

Each .http file contains basic GET requests demonstrating API versioning across different versions. The files focus on showcasing how to call versioned endpoints using both query string and URL segment versioning patterns.

Coverage

  • ASP.NET Core: 6 WebApi + 5 OData examples
  • ASP.NET (Legacy): 4 WebApi + 5 OData examples

Structure

Each .http file includes:

  • Configurable @baseUrl variable
  • Basic GET requests with different API versions (0.9, 1.0, 2.0, 3.0)
  • Query string versioning (?api-version=X.X)
  • URL segment versioning (/api/vX.X/)
  • OData query examples ($select, $filter, $expand) for OData endpoints
  • Deprecated version examples (v0.9) where applicable

Example

###
# MinimalOpenApiExample - ASP.NET Core Minimal API with OpenAPI and Versioning
###

@baseUrl = http://localhost:5000

### Orders - Get by ID - Version 1.0
GET {{baseUrl}}/api/orders/1?api-version=1.0

### Orders - Get All - Version 2.0
GET {{baseUrl}}/api/orders?api-version=2.0

### People - Get All - Version 3.0
GET {{baseUrl}}/api/v3.0/people

Files are compatible with Visual Studio, VS Code REST Client extension, JetBrains HTTP Client, and other HTTP file editors.

Fixes #1146

Original prompt

This section details on the original issue you should resolve

<issue_title>.http files for all API examples in this project.</issue_title> <issue_description>Generate .http files for all API examples in this project under the folder examples. Each file should include endpoints, headers, and sample requests.</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes dotnet/aspnet-api-versioning#1146

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar Nov 21 '25 17:11 Copilot

update all the .http files and only show basic GET methods with different versions.

Updated all .http files to only show basic GET methods with different API versions. Removed POST, PATCH, and DELETE requests from all 20 files. Commit: bbbade7

Copilot avatar Nov 21 '25 22:11 Copilot