@typespec/http-specs 0.1.0-alpha.33-dev.4 → 0.1.0-alpha.33-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/specs/encode/duration/mockapi.d.ts.map +1 -1
- package/dist/specs/encode/duration/mockapi.js +56 -21
- package/dist/specs/encode/duration/mockapi.js.map +1 -1
- package/dist/specs/special-words/mockapi.d.ts.map +1 -1
- package/dist/specs/special-words/mockapi.js +18 -0
- package/dist/specs/special-words/mockapi.js.map +1 -1
- package/manifest.json +16 -1
- package/package.json +8 -8
- package/spec-summary.md +7 -0
- package/specs/encode/duration/mockapi.ts +70 -28
- package/specs/special-words/main.tsp +55 -0
- package/specs/special-words/mockapi.ts +20 -1
- package/temp/.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockapi.d.ts","sourceRoot":"","sources":["../../../../specs/encode/duration/mockapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,eAAe,
|
|
1
|
+
{"version":3,"file":"mockapi.d.ts","sourceRoot":"","sources":["../../../../specs/encode/duration/mockapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAM,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { json, passOnSuccess, } from "@typespec/spec-api";
|
|
1
|
+
import { json, passOnSuccess, ValidationError, } from "@typespec/spec-api";
|
|
2
2
|
export const Scenarios = {};
|
|
3
3
|
function createBodyServerTests(uri, data, value) {
|
|
4
4
|
return passOnSuccess({
|
|
@@ -75,6 +75,29 @@ function createQueryServerTests(uri, paramData, value, collectionFormat) {
|
|
|
75
75
|
kind: "MockApiDefinition",
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
+
function createQueryFloatServerTests(uri, paramData, value) {
|
|
79
|
+
return passOnSuccess({
|
|
80
|
+
uri,
|
|
81
|
+
method: "get",
|
|
82
|
+
request: {
|
|
83
|
+
query: paramData,
|
|
84
|
+
},
|
|
85
|
+
response: {
|
|
86
|
+
status: 204,
|
|
87
|
+
},
|
|
88
|
+
handler: (req) => {
|
|
89
|
+
const actual = req.query["input"];
|
|
90
|
+
const actualNum = parseFloat(actual);
|
|
91
|
+
if (isNaN(actualNum) || actualNum !== value) {
|
|
92
|
+
throw new ValidationError(`Expected query param input=${value} but got ${actual}`, String(value), actual);
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
status: 204,
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
kind: "MockApiDefinition",
|
|
99
|
+
});
|
|
100
|
+
}
|
|
78
101
|
Scenarios.Encode_Duration_Query_default = createQueryServerTests("/encode/duration/query/default", {
|
|
79
102
|
input: "P40D",
|
|
80
103
|
}, "P40D");
|
|
@@ -96,27 +119,27 @@ Scenarios.Encode_Duration_Query_float64Seconds = createQueryServerTests("/encode
|
|
|
96
119
|
Scenarios.Encode_Duration_Query_int32Milliseconds = createQueryServerTests("/encode/duration/query/int32-milliseconds", {
|
|
97
120
|
input: 36000,
|
|
98
121
|
}, "36000");
|
|
99
|
-
Scenarios.Encode_Duration_Query_floatMilliseconds =
|
|
122
|
+
Scenarios.Encode_Duration_Query_floatMilliseconds = createQueryFloatServerTests("/encode/duration/query/float-milliseconds", {
|
|
100
123
|
input: 35625,
|
|
101
|
-
},
|
|
102
|
-
Scenarios.Encode_Duration_Query_float64Milliseconds =
|
|
124
|
+
}, 35625);
|
|
125
|
+
Scenarios.Encode_Duration_Query_float64Milliseconds = createQueryFloatServerTests("/encode/duration/query/float64-milliseconds", {
|
|
103
126
|
input: 35625,
|
|
104
|
-
},
|
|
127
|
+
}, 35625);
|
|
105
128
|
Scenarios.Encode_Duration_Query_int32MillisecondsArray = createQueryServerTests("/encode/duration/query/int32-milliseconds-array", {
|
|
106
129
|
input: [36000, 47000].join(","),
|
|
107
130
|
}, ["36000", "47000"], "csv");
|
|
108
131
|
Scenarios.Encode_Duration_Query_int32SecondsLargerUnit = createQueryServerTests("/encode/duration/query/int32-seconds-larger-unit", {
|
|
109
132
|
input: 120,
|
|
110
133
|
}, "120");
|
|
111
|
-
Scenarios.Encode_Duration_Query_floatSecondsLargerUnit =
|
|
134
|
+
Scenarios.Encode_Duration_Query_floatSecondsLargerUnit = createQueryFloatServerTests("/encode/duration/query/float-seconds-larger-unit", {
|
|
112
135
|
input: 150,
|
|
113
|
-
},
|
|
136
|
+
}, 150);
|
|
114
137
|
Scenarios.Encode_Duration_Query_int32MillisecondsLargerUnit = createQueryServerTests("/encode/duration/query/int32-milliseconds-larger-unit", {
|
|
115
138
|
input: 180000,
|
|
116
139
|
}, "180000");
|
|
117
|
-
Scenarios.Encode_Duration_Query_floatMillisecondsLargerUnit =
|
|
140
|
+
Scenarios.Encode_Duration_Query_floatMillisecondsLargerUnit = createQueryFloatServerTests("/encode/duration/query/float-milliseconds-larger-unit", {
|
|
118
141
|
input: 210000,
|
|
119
|
-
},
|
|
142
|
+
}, 210000);
|
|
120
143
|
function createHeaderServerTests(uri, headersData, value) {
|
|
121
144
|
return passOnSuccess({
|
|
122
145
|
uri,
|
|
@@ -130,6 +153,26 @@ function createHeaderServerTests(uri, headersData, value) {
|
|
|
130
153
|
kind: "MockApiDefinition",
|
|
131
154
|
});
|
|
132
155
|
}
|
|
156
|
+
function createHeaderFloatServerTests(uri, value) {
|
|
157
|
+
return passOnSuccess({
|
|
158
|
+
uri,
|
|
159
|
+
method: "get",
|
|
160
|
+
response: {
|
|
161
|
+
status: 204,
|
|
162
|
+
},
|
|
163
|
+
handler: (req) => {
|
|
164
|
+
const actual = req.headers["duration"];
|
|
165
|
+
const actualNum = parseFloat(actual);
|
|
166
|
+
if (isNaN(actualNum) || actualNum !== value) {
|
|
167
|
+
throw new ValidationError(`Expected header duration=${value} but got ${actual}`, String(value), actual);
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
status: 204,
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
kind: "MockApiDefinition",
|
|
174
|
+
});
|
|
175
|
+
}
|
|
133
176
|
Scenarios.Encode_Duration_Header_default = createHeaderServerTests("/encode/duration/header/default", {
|
|
134
177
|
duration: "P40D",
|
|
135
178
|
}, "P40D");
|
|
@@ -151,25 +194,17 @@ Scenarios.Encode_Duration_Header_iso8601Array = createHeaderServerTests("/encode
|
|
|
151
194
|
Scenarios.Encode_Duration_Header_int32Milliseconds = createHeaderServerTests("/encode/duration/header/int32-milliseconds", {
|
|
152
195
|
duration: "36000",
|
|
153
196
|
}, "36000");
|
|
154
|
-
Scenarios.Encode_Duration_Header_floatMilliseconds =
|
|
155
|
-
|
|
156
|
-
}, "35625");
|
|
157
|
-
Scenarios.Encode_Duration_Header_float64Milliseconds = createHeaderServerTests("/encode/duration/header/float64-milliseconds", {
|
|
158
|
-
duration: "35625",
|
|
159
|
-
}, "35625");
|
|
197
|
+
Scenarios.Encode_Duration_Header_floatMilliseconds = createHeaderFloatServerTests("/encode/duration/header/float-milliseconds", 35625);
|
|
198
|
+
Scenarios.Encode_Duration_Header_float64Milliseconds = createHeaderFloatServerTests("/encode/duration/header/float64-milliseconds", 35625);
|
|
160
199
|
Scenarios.Encode_Duration_Header_int32MillisecondsArray = createHeaderServerTests("/encode/duration/header/int32-milliseconds-array", {
|
|
161
200
|
duration: ["36000", "47000"].join(","),
|
|
162
201
|
}, "36000,47000");
|
|
163
202
|
Scenarios.Encode_Duration_Header_int32SecondsLargerUnit = createHeaderServerTests("/encode/duration/header/int32-seconds-larger-unit", {
|
|
164
203
|
duration: "120",
|
|
165
204
|
}, "120");
|
|
166
|
-
Scenarios.Encode_Duration_Header_floatSecondsLargerUnit =
|
|
167
|
-
duration: "150",
|
|
168
|
-
}, "150");
|
|
205
|
+
Scenarios.Encode_Duration_Header_floatSecondsLargerUnit = createHeaderFloatServerTests("/encode/duration/header/float-seconds-larger-unit", 150);
|
|
169
206
|
Scenarios.Encode_Duration_Header_int32MillisecondsLargerUnit = createHeaderServerTests("/encode/duration/header/int32-milliseconds-larger-unit", {
|
|
170
207
|
duration: "180000",
|
|
171
208
|
}, "180000");
|
|
172
|
-
Scenarios.Encode_Duration_Header_floatMillisecondsLargerUnit =
|
|
173
|
-
duration: "210000",
|
|
174
|
-
}, "210000");
|
|
209
|
+
Scenarios.Encode_Duration_Header_floatMillisecondsLargerUnit = createHeaderFloatServerTests("/encode/duration/header/float-milliseconds-larger-unit", 210000);
|
|
175
210
|
//# sourceMappingURL=mockapi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockapi.js","sourceRoot":"","sources":["../../../../specs/encode/duration/mockapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAEJ,aAAa,
|
|
1
|
+
{"version":3,"file":"mockapi.js","sourceRoot":"","sources":["../../../../specs/encode/duration/mockapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EAEJ,aAAa,EAEb,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,SAAS,GAAoC,EAAE,CAAC;AAE7D,SAAS,qBAAqB,CAAC,GAAW,EAAE,IAAS,EAAE,KAAU;IAC/D,OAAO,aAAa,CAAC;QACnB,GAAG;QACH,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;SACjB;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;SACjB;QACD,IAAI,EAAE,mBAAmB;KAC1B,CAAC,CAAC;AACL,CAAC;AACD,SAAS,CAAC,gCAAgC,GAAG,qBAAqB,CAChE,mCAAmC,EACnC;IACE,KAAK,EAAE,MAAM;CACd,EACD,MAAM,CACP,CAAC;AACF,SAAS,CAAC,qCAAqC,GAAG,qBAAqB,CACrE,yCAAyC,EACzC;IACE,KA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A4C,EAC5C,KAAK,CACN,CAAC;AACF,SAAS,CAAC,0CAA0C,GAAG,4BAA4B,CACjF,8CAA8C,EAC9C,KAAK,CACN,CAAC;AACF,SAAS,CAAC,6CAA6C,GAAG,uBAAuB,CAC/E,kDAAkD,EAClD;IACE,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;CACvC,EACD,aAAa,CACd,CAAC;AACF,SAAS,CAAC,6CAA6C,GAAG,uBAAuB,CAC/E,mDAAmD,EACnD;IACE,QAAQ,EAAE,KAAK;CAChB,EACD,KAAK,CACN,CAAC;AACF,SAAS,CAAC,6CAA6C,GAAG,4BAA4B,CACpF,mDAAmD,EACnD,GAAG,CACJ,CAAC;AACF,SAAS,CAAC,kDAAkD,GAAG,uBAAuB,CACpF,wDAAwD,EACxD;IACE,QAAQ,EAAE,QAAQ;CACnB,EACD,QAAQ,CACT,CAAC;AACF,SAAS,CAAC,kDAAkD,GAAG,4BAA4B,CACzF,wDAAwD,EACxD,MAAM,CACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockapi.d.ts","sourceRoot":"","sources":["../../../specs/special-words/mockapi.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"mockapi.d.ts","sourceRoot":"","sources":["../../../specs/special-words/mockapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAEvF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAM,CAAC"}
|
|
@@ -255,4 +255,22 @@ Scenarios.SpecialWords_Parameters_yield = createParametersTests(`/special-words/
|
|
|
255
255
|
Scenarios.SpecialWords_Parameters_cancellationToken = createParametersTests(`/special-words/parameters/cancellationToken`, {
|
|
256
256
|
cancellationToken: "ok",
|
|
257
257
|
}, "cancellationToken");
|
|
258
|
+
Scenarios.SpecialWords_ExtensibleStrings_putExtensibleStringValue = passOnSuccess({
|
|
259
|
+
uri: `/special-words/extensible-strings/string`,
|
|
260
|
+
method: "put",
|
|
261
|
+
request: {
|
|
262
|
+
body: json("class"),
|
|
263
|
+
},
|
|
264
|
+
response: {
|
|
265
|
+
status: 200,
|
|
266
|
+
body: json("class"),
|
|
267
|
+
},
|
|
268
|
+
handler: (req) => {
|
|
269
|
+
return {
|
|
270
|
+
status: 200,
|
|
271
|
+
body: json(req.body),
|
|
272
|
+
};
|
|
273
|
+
},
|
|
274
|
+
kind: "MockApiDefinition",
|
|
275
|
+
});
|
|
258
276
|
//# sourceMappingURL=mockapi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockapi.js","sourceRoot":"","sources":["../../../specs/special-words/mockapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"mockapi.js","sourceRoot":"","sources":["../../../specs/special-words/mockapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,aAAa,EAAmB,MAAM,oBAAoB,CAAC;AAEvF,MAAM,CAAC,MAAM,SAAS,GAAoC,EAAE,CAAC;AAE7D,SAAS,CAAC,wCAAwC,GAAG,aAAa,CAAC;IACjE,GAAG,EAAE,+CAA+C;IACpD,MAAM,EAAE,MAAM;IACd,OAAO,EAAE;QACP,IAAI,EAAE,IAAI,CAAC;YACT,WAAW,EAAE,IAAI;SAClB,CAAC;KACH;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,GAAG;KACZ;IACD,IAAI,EAAE,mBAAmB;CAC1B,CAAC,CAAC;AAEH,SAAS,CAAC,wCAAwC,GAAG,aAAa,CAAC;IACjE,GAAG,EAAE,8CAA8C;IACnD,MAAM,EAAE,MAAM;IACd,OAAO,EAAE;QACP,IAAI,EAAE,IAAI,CAAC;YACT,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,IAAI;YAC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E,GAAG;YACX,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;SACrB,CAAC;IACJ,CAAC;IACD,IAAI,EAAE,mBAAmB;CAC1B,CAAC,CAAC"}
|
package/manifest.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"sourceUrl": "https://github.com/microsoft/typespec/tree/main/packages/http-specs/specs/{scenarioPath}",
|
|
5
5
|
"packageName": "@typespec/http-specs",
|
|
6
6
|
"displayName": "Http Specs",
|
|
7
|
-
"commit": "
|
|
7
|
+
"commit": "a8f07f42272af8394f7c4b95a28665af6e001340",
|
|
8
8
|
"scenarios": [
|
|
9
9
|
{
|
|
10
10
|
"name": "Authentication_ApiKey_invalid",
|
|
@@ -4056,6 +4056,21 @@
|
|
|
4056
4056
|
}
|
|
4057
4057
|
}
|
|
4058
4058
|
},
|
|
4059
|
+
{
|
|
4060
|
+
"name": "SpecialWords_ExtensibleStrings_putExtensibleStringValue",
|
|
4061
|
+
"scenarioDoc": "Verify that enum members with special word names can be sent and received properly.\nSend 'class' and expect the same value back.",
|
|
4062
|
+
"location": {
|
|
4063
|
+
"path": "special-words/main.tsp",
|
|
4064
|
+
"start": {
|
|
4065
|
+
"line": 337,
|
|
4066
|
+
"character": 2
|
|
4067
|
+
},
|
|
4068
|
+
"end": {
|
|
4069
|
+
"line": 344,
|
|
4070
|
+
"character": 74
|
|
4071
|
+
}
|
|
4072
|
+
}
|
|
4073
|
+
},
|
|
4059
4074
|
{
|
|
4060
4075
|
"name": "SpecialWords_ModelProperties_dictMethods",
|
|
4061
4076
|
"scenarioDoc": "Verify that model properties can use names that are Python dict methods. These names (keys, items, values, etc.) may conflict with Python's dict class methods.\n\nSend\n\n```json\n{\n \"keys\": \"ok\",\n \"items\": \"ok\",\n \"values\": \"ok\",\n \"popitem\": \"ok\",\n \"clear\": \"ok\",\n \"update\": \"ok\",\n \"setdefault\": \"ok\",\n \"pop\": \"ok\",\n \"get\": \"ok\",\n \"copy\": \"ok\"\n}\n```",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/http-specs",
|
|
3
3
|
"displayName": "Http Specs",
|
|
4
|
-
"version": "0.1.0-alpha.33-dev.
|
|
4
|
+
"version": "0.1.0-alpha.33-dev.6",
|
|
5
5
|
"description": "Spec scenarios and mock apis",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"type": "module",
|
|
@@ -23,25 +23,25 @@
|
|
|
23
23
|
"homepage": "https://github.com/microsoft/typespec#readme",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@typespec/spec-api": "^0.1.0-alpha.12 || >= 0.1.0-alpha.13-dev.1",
|
|
26
|
-
"@typespec/spector": "^0.1.0-alpha.23 || >= 0.1.0-alpha.24-dev.
|
|
26
|
+
"@typespec/spector": "^0.1.0-alpha.23 || >= 0.1.0-alpha.24-dev.4",
|
|
27
27
|
"deep-equal": "^2.2.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/deep-equal": "^1.0.1",
|
|
31
31
|
"@types/multer": "^2.0.0",
|
|
32
32
|
"@types/node": "~25.3.0",
|
|
33
|
-
"@typespec/json-schema": "^1.9.0 || >= 1.10.0-dev.
|
|
34
|
-
"@typespec/openapi": "^1.9.0 || >= 1.10.0-dev.
|
|
35
|
-
"@typespec/openapi3": "^1.9.0 || >= 1.10.0-dev.
|
|
33
|
+
"@typespec/json-schema": "^1.9.0 || >= 1.10.0-dev.3",
|
|
34
|
+
"@typespec/openapi": "^1.9.0 || >= 1.10.0-dev.4",
|
|
35
|
+
"@typespec/openapi3": "^1.9.0 || >= 1.10.0-dev.8",
|
|
36
36
|
"concurrently": "^9.1.2",
|
|
37
37
|
"rimraf": "~6.1.3",
|
|
38
38
|
"typescript": "~5.9.3"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@typespec/compiler": "^1.9.0 || >= 1.10.0-dev.
|
|
42
|
-
"@typespec/http": "^1.9.1 || >= 1.10.0-dev.
|
|
41
|
+
"@typespec/compiler": "^1.9.0 || >= 1.10.0-dev.15",
|
|
42
|
+
"@typespec/http": "^1.9.1 || >= 1.10.0-dev.5",
|
|
43
43
|
"@typespec/rest": "^0.79.0 || >= 0.80.0-dev.2",
|
|
44
|
-
"@typespec/versioning": "^0.79.0 || >= 0.80.0-dev.
|
|
44
|
+
"@typespec/versioning": "^0.79.0 || >= 0.80.0-dev.3",
|
|
45
45
|
"@typespec/xml": "^0.79.0 || >= 0.80.0-dev.2"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
package/spec-summary.md
CHANGED
|
@@ -3977,6 +3977,13 @@ Expected header parameters:
|
|
|
3977
3977
|
|
|
3978
3978
|
Check we recognize Repeatability-Request-ID and Repeatability-First-Sent.
|
|
3979
3979
|
|
|
3980
|
+
### SpecialWords_ExtensibleStrings_putExtensibleStringValue
|
|
3981
|
+
|
|
3982
|
+
- Endpoint: `put /special-words/extensible-strings/string`
|
|
3983
|
+
|
|
3984
|
+
Verify that enum members with special word names can be sent and received properly.
|
|
3985
|
+
Send 'class' and expect the same value back.
|
|
3986
|
+
|
|
3980
3987
|
### SpecialWords_ModelProperties_dictMethods
|
|
3981
3988
|
|
|
3982
3989
|
- Endpoint: `get /special-words/model-properties/dict-methods`
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
MockRequest,
|
|
5
5
|
passOnSuccess,
|
|
6
6
|
ScenarioMockApi,
|
|
7
|
+
ValidationError,
|
|
7
8
|
} from "@typespec/spec-api";
|
|
8
9
|
|
|
9
10
|
export const Scenarios: Record<string, ScenarioMockApi> = {};
|
|
@@ -146,6 +147,34 @@ function createQueryServerTests(
|
|
|
146
147
|
kind: "MockApiDefinition",
|
|
147
148
|
});
|
|
148
149
|
}
|
|
150
|
+
|
|
151
|
+
function createQueryFloatServerTests(uri: string, paramData: any, value: number) {
|
|
152
|
+
return passOnSuccess({
|
|
153
|
+
uri,
|
|
154
|
+
method: "get",
|
|
155
|
+
request: {
|
|
156
|
+
query: paramData,
|
|
157
|
+
},
|
|
158
|
+
response: {
|
|
159
|
+
status: 204,
|
|
160
|
+
},
|
|
161
|
+
handler: (req: MockRequest) => {
|
|
162
|
+
const actual = req.query["input"] as string;
|
|
163
|
+
const actualNum = parseFloat(actual);
|
|
164
|
+
if (isNaN(actualNum) || actualNum !== value) {
|
|
165
|
+
throw new ValidationError(
|
|
166
|
+
`Expected query param input=${value} but got ${actual}`,
|
|
167
|
+
String(value),
|
|
168
|
+
actual,
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
status: 204,
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
kind: "MockApiDefinition",
|
|
176
|
+
});
|
|
177
|
+
}
|
|
149
178
|
Scenarios.Encode_Duration_Query_default = createQueryServerTests(
|
|
150
179
|
"/encode/duration/query/default",
|
|
151
180
|
{
|
|
@@ -197,19 +226,19 @@ Scenarios.Encode_Duration_Query_int32Milliseconds = createQueryServerTests(
|
|
|
197
226
|
},
|
|
198
227
|
"36000",
|
|
199
228
|
);
|
|
200
|
-
Scenarios.Encode_Duration_Query_floatMilliseconds =
|
|
229
|
+
Scenarios.Encode_Duration_Query_floatMilliseconds = createQueryFloatServerTests(
|
|
201
230
|
"/encode/duration/query/float-milliseconds",
|
|
202
231
|
{
|
|
203
232
|
input: 35625,
|
|
204
233
|
},
|
|
205
|
-
|
|
234
|
+
35625,
|
|
206
235
|
);
|
|
207
|
-
Scenarios.Encode_Duration_Query_float64Milliseconds =
|
|
236
|
+
Scenarios.Encode_Duration_Query_float64Milliseconds = createQueryFloatServerTests(
|
|
208
237
|
"/encode/duration/query/float64-milliseconds",
|
|
209
238
|
{
|
|
210
239
|
input: 35625,
|
|
211
240
|
},
|
|
212
|
-
|
|
241
|
+
35625,
|
|
213
242
|
);
|
|
214
243
|
Scenarios.Encode_Duration_Query_int32MillisecondsArray = createQueryServerTests(
|
|
215
244
|
"/encode/duration/query/int32-milliseconds-array",
|
|
@@ -226,12 +255,12 @@ Scenarios.Encode_Duration_Query_int32SecondsLargerUnit = createQueryServerTests(
|
|
|
226
255
|
},
|
|
227
256
|
"120",
|
|
228
257
|
);
|
|
229
|
-
Scenarios.Encode_Duration_Query_floatSecondsLargerUnit =
|
|
258
|
+
Scenarios.Encode_Duration_Query_floatSecondsLargerUnit = createQueryFloatServerTests(
|
|
230
259
|
"/encode/duration/query/float-seconds-larger-unit",
|
|
231
260
|
{
|
|
232
261
|
input: 150,
|
|
233
262
|
},
|
|
234
|
-
|
|
263
|
+
150,
|
|
235
264
|
);
|
|
236
265
|
Scenarios.Encode_Duration_Query_int32MillisecondsLargerUnit = createQueryServerTests(
|
|
237
266
|
"/encode/duration/query/int32-milliseconds-larger-unit",
|
|
@@ -240,12 +269,12 @@ Scenarios.Encode_Duration_Query_int32MillisecondsLargerUnit = createQueryServerT
|
|
|
240
269
|
},
|
|
241
270
|
"180000",
|
|
242
271
|
);
|
|
243
|
-
Scenarios.Encode_Duration_Query_floatMillisecondsLargerUnit =
|
|
272
|
+
Scenarios.Encode_Duration_Query_floatMillisecondsLargerUnit = createQueryFloatServerTests(
|
|
244
273
|
"/encode/duration/query/float-milliseconds-larger-unit",
|
|
245
274
|
{
|
|
246
275
|
input: 210000,
|
|
247
276
|
},
|
|
248
|
-
|
|
277
|
+
210000,
|
|
249
278
|
);
|
|
250
279
|
|
|
251
280
|
function createHeaderServerTests(uri: string, headersData: any, value: any) {
|
|
@@ -262,6 +291,31 @@ function createHeaderServerTests(uri: string, headersData: any, value: any) {
|
|
|
262
291
|
});
|
|
263
292
|
}
|
|
264
293
|
|
|
294
|
+
function createHeaderFloatServerTests(uri: string, value: number) {
|
|
295
|
+
return passOnSuccess({
|
|
296
|
+
uri,
|
|
297
|
+
method: "get",
|
|
298
|
+
response: {
|
|
299
|
+
status: 204,
|
|
300
|
+
},
|
|
301
|
+
handler: (req: MockRequest) => {
|
|
302
|
+
const actual = req.headers["duration"];
|
|
303
|
+
const actualNum = parseFloat(actual);
|
|
304
|
+
if (isNaN(actualNum) || actualNum !== value) {
|
|
305
|
+
throw new ValidationError(
|
|
306
|
+
`Expected header duration=${value} but got ${actual}`,
|
|
307
|
+
String(value),
|
|
308
|
+
actual,
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
return {
|
|
312
|
+
status: 204,
|
|
313
|
+
};
|
|
314
|
+
},
|
|
315
|
+
kind: "MockApiDefinition",
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
|
|
265
319
|
Scenarios.Encode_Duration_Header_default = createHeaderServerTests(
|
|
266
320
|
"/encode/duration/header/default",
|
|
267
321
|
{
|
|
@@ -312,19 +366,13 @@ Scenarios.Encode_Duration_Header_int32Milliseconds = createHeaderServerTests(
|
|
|
312
366
|
},
|
|
313
367
|
"36000",
|
|
314
368
|
);
|
|
315
|
-
Scenarios.Encode_Duration_Header_floatMilliseconds =
|
|
369
|
+
Scenarios.Encode_Duration_Header_floatMilliseconds = createHeaderFloatServerTests(
|
|
316
370
|
"/encode/duration/header/float-milliseconds",
|
|
317
|
-
|
|
318
|
-
duration: "35625",
|
|
319
|
-
},
|
|
320
|
-
"35625",
|
|
371
|
+
35625,
|
|
321
372
|
);
|
|
322
|
-
Scenarios.Encode_Duration_Header_float64Milliseconds =
|
|
373
|
+
Scenarios.Encode_Duration_Header_float64Milliseconds = createHeaderFloatServerTests(
|
|
323
374
|
"/encode/duration/header/float64-milliseconds",
|
|
324
|
-
|
|
325
|
-
duration: "35625",
|
|
326
|
-
},
|
|
327
|
-
"35625",
|
|
375
|
+
35625,
|
|
328
376
|
);
|
|
329
377
|
Scenarios.Encode_Duration_Header_int32MillisecondsArray = createHeaderServerTests(
|
|
330
378
|
"/encode/duration/header/int32-milliseconds-array",
|
|
@@ -340,12 +388,9 @@ Scenarios.Encode_Duration_Header_int32SecondsLargerUnit = createHeaderServerTest
|
|
|
340
388
|
},
|
|
341
389
|
"120",
|
|
342
390
|
);
|
|
343
|
-
Scenarios.Encode_Duration_Header_floatSecondsLargerUnit =
|
|
391
|
+
Scenarios.Encode_Duration_Header_floatSecondsLargerUnit = createHeaderFloatServerTests(
|
|
344
392
|
"/encode/duration/header/float-seconds-larger-unit",
|
|
345
|
-
|
|
346
|
-
duration: "150",
|
|
347
|
-
},
|
|
348
|
-
"150",
|
|
393
|
+
150,
|
|
349
394
|
);
|
|
350
395
|
Scenarios.Encode_Duration_Header_int32MillisecondsLargerUnit = createHeaderServerTests(
|
|
351
396
|
"/encode/duration/header/int32-milliseconds-larger-unit",
|
|
@@ -354,10 +399,7 @@ Scenarios.Encode_Duration_Header_int32MillisecondsLargerUnit = createHeaderServe
|
|
|
354
399
|
},
|
|
355
400
|
"180000",
|
|
356
401
|
);
|
|
357
|
-
Scenarios.Encode_Duration_Header_floatMillisecondsLargerUnit =
|
|
402
|
+
Scenarios.Encode_Duration_Header_floatMillisecondsLargerUnit = createHeaderFloatServerTests(
|
|
358
403
|
"/encode/duration/header/float-milliseconds-larger-unit",
|
|
359
|
-
|
|
360
|
-
duration: "210000",
|
|
361
|
-
},
|
|
362
|
-
"210000",
|
|
404
|
+
210000,
|
|
363
405
|
);
|
|
@@ -289,3 +289,58 @@ namespace ModelProperties {
|
|
|
289
289
|
@route("list")
|
|
290
290
|
op withList(@body body: ModelWithList): void;
|
|
291
291
|
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Verify enum member names that are special words using extensible enum (union).
|
|
295
|
+
*/
|
|
296
|
+
union ExtensibleString {
|
|
297
|
+
string,
|
|
298
|
+
and: "and",
|
|
299
|
+
as: "as",
|
|
300
|
+
assert: "assert",
|
|
301
|
+
async: "async",
|
|
302
|
+
await: "await",
|
|
303
|
+
break: "break",
|
|
304
|
+
class: "class",
|
|
305
|
+
constructor: "constructor",
|
|
306
|
+
continue: "continue",
|
|
307
|
+
def: "def",
|
|
308
|
+
del: "del",
|
|
309
|
+
elif: "elif",
|
|
310
|
+
`else`: "else",
|
|
311
|
+
except: "except",
|
|
312
|
+
exec: "exec",
|
|
313
|
+
finally: "finally",
|
|
314
|
+
for: "for",
|
|
315
|
+
from: "from",
|
|
316
|
+
global: "global",
|
|
317
|
+
`if`: "if",
|
|
318
|
+
`import`: "import",
|
|
319
|
+
in: "in",
|
|
320
|
+
`is`: "is",
|
|
321
|
+
lambda: "lambda",
|
|
322
|
+
not: "not",
|
|
323
|
+
or: "or",
|
|
324
|
+
pass: "pass",
|
|
325
|
+
raise: "raise",
|
|
326
|
+
`return`: "return",
|
|
327
|
+
try: "try",
|
|
328
|
+
while: "while",
|
|
329
|
+
with: "with",
|
|
330
|
+
yield: "yield",
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Verify enum member names that are special words.
|
|
335
|
+
*/
|
|
336
|
+
@route("/extensible-strings")
|
|
337
|
+
interface ExtensibleStrings {
|
|
338
|
+
@scenario
|
|
339
|
+
@scenarioDoc("""
|
|
340
|
+
Verify that enum members with special word names can be sent and received properly.
|
|
341
|
+
Send 'class' and expect the same value back.
|
|
342
|
+
""")
|
|
343
|
+
@put
|
|
344
|
+
@route("/string")
|
|
345
|
+
putExtensibleStringValue(@body body: ExtensibleString): ExtensibleString;
|
|
346
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { json, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api";
|
|
1
|
+
import { json, MockRequest, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api";
|
|
2
2
|
|
|
3
3
|
export const Scenarios: Record<string, ScenarioMockApi> = {};
|
|
4
4
|
|
|
@@ -419,3 +419,22 @@ Scenarios.SpecialWords_Parameters_cancellationToken = createParametersTests(
|
|
|
419
419
|
},
|
|
420
420
|
"cancellationToken",
|
|
421
421
|
);
|
|
422
|
+
|
|
423
|
+
Scenarios.SpecialWords_ExtensibleStrings_putExtensibleStringValue = passOnSuccess({
|
|
424
|
+
uri: `/special-words/extensible-strings/string`,
|
|
425
|
+
method: "put",
|
|
426
|
+
request: {
|
|
427
|
+
body: json("class"),
|
|
428
|
+
},
|
|
429
|
+
response: {
|
|
430
|
+
status: 200,
|
|
431
|
+
body: json("class"),
|
|
432
|
+
},
|
|
433
|
+
handler: (req: MockRequest) => {
|
|
434
|
+
return {
|
|
435
|
+
status: 200,
|
|
436
|
+
body: json(req.body),
|
|
437
|
+
};
|
|
438
|
+
},
|
|
439
|
+
kind: "MockApiDefinition",
|
|
440
|
+
});
|