Skip to content

Commit 3e669c7

Browse files
authored
Split core HTTP functionality from @typespec/rest into @typespec/http (microsoft#1668)
* Decouple `autoRoute` from HTTP library routing implementation * Split HTTP functionality of `@typespec/rest` to `@typespec/http` * Lint and format * Add Rush change files * Update playground * Generate separate documentation for HTTP library * Minor cleanup and library references * Add back `isAutoRoute` accessor function * Add `OperationParameterOptions` to customize operation parameter logic * Update playground configuration to add `@typespec/http` import * Remove duplicate diagnostics in REST library * Update REST and HTTP README files * Add a changelog entry about `@routeReset` removal
1 parent d1b20c1 commit 3e669c7

File tree

83 files changed

+2438
-1883
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2438
-1883
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Here is a very small TypeSpec example that uses the `@typespec/openapi3` library
100100
#### sample.tsp
101101

102102
```typespec
103-
import "@typespec/rest";
103+
import "@typespec/http";
104104
105105
using TypeSpec.Http;
106106
@@ -183,6 +183,7 @@ Example
183183
// Stable setup
184184
"dependencies": {
185185
"@typespec/compiler": "~0.30.0",
186+
"@typespec/http": "~0.14.0",
186187
"@typespec/rest": "~0.14.0",
187188
"@typespec/openapi": "~0.9.0",
188189
}
@@ -191,6 +192,7 @@ Example
191192
// In this example: compiler and openapi have changes but rest library has none
192193
"dependencies": {
193194
"@typespec/compiler": "~0.31.0-dev.5",
195+
"@typespec/http": "~0.14.0",
194196
"@typespec/rest": "~0.14.0", // No changes to @typespec/rest library so need to stay the latest.
195197
"@typespec/openapi": "~0.10.0-dev.2",
196198
}
@@ -203,6 +205,7 @@ Example
203205
| Core functionality | | | |
204206
| [@typespec/compiler][compiler_src] | [Changelog][compiler_chg] | [![](https://img.shields.io/npm/v/@typespec/compiler)](https://www.npmjs.com/package/@typespec/compiler) | ![](https://img.shields.io/npm/v/@typespec/compiler/next) |
205207
| TypeSpec Libraries | | | |
208+
| [@typespec/http][http_src] | [Changelog][http_chg] | [![](https://img.shields.io/npm/v/@typespec/http)](https://www.npmjs.com/package/@typespec/http) | ![](https://img.shields.io/npm/v/@typespec/http/next) |
206209
| [@typespec/rest][rest_src] | [Changelog][rest_chg] | [![](https://img.shields.io/npm/v/@typespec/rest)](https://www.npmjs.com/package/@typespec/rest) | ![](https://img.shields.io/npm/v/@typespec/rest/next) |
207210
| [@typespec/openapi][openapi_src] | [Changelog][openapi_chg] | [![](https://img.shields.io/npm/v/@typespec/openapi)](https://www.npmjs.com/package/@typespec/openapi) | ![](https://img.shields.io/npm/v/@typespec/openapi/next) |
208211
| [@typespec/openapi3][openapi3_src] | [Changelog][openapi3_chg] | [![](https://img.shields.io/npm/v/@typespec/openapi3)](https://www.npmjs.com/package/@typespec/openapi3) | ![](https://img.shields.io/npm/v/@typespec/openapi3/next) |
@@ -215,6 +218,8 @@ Example
215218

216219
[compiler_src]: packages/compiler
217220
[compiler_chg]: packages/compiler/CHANGELOG.md
221+
[http_src]: packages/http
222+
[http_chg]: packages/http/CHANGELOG.md
218223
[rest_src]: packages/rest
219224
[rest_chg]: packages/rest/CHANGELOG.md
220225
[openapi_src]: packages/openapi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@typespec/http",
5+
"comment": "Move core HTTP functionality from `@typespec/rest` into a new `@typespec/http` library",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@typespec/http"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@typespec/openapi",
5+
"comment": "Use new `@typespec/http` library",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@typespec/openapi"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@typespec/openapi3",
5+
"comment": "Use new `@typespec/http` library",
6+
"type": "none"
7+
}
8+
],
9+
"packageName": "@typespec/openapi3"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@typespec/rest",
5+
"comment": "Move core HTTP functionality from `@typespec/rest` into a new `@typespec/http` library",
6+
"type": "none"
7+
},
8+
{
9+
"packageName": "@typespec/rest",
10+
"comment": "**Breaking change:** The `@autoRoute` decorator can no longer be applied to namespaces",
11+
"type": "none"
12+
},
13+
{
14+
"packageName": "@typespec/rest",
15+
"comment": "**Breaking change:** The unimplemented `@routeReset` decorator has been removed",
16+
"type": "none"
17+
}
18+
],
19+
"packageName": "@typespec/rest"
20+
}

0 commit comments

Comments
 (0)