@typespec/http-specs 0.1.0-alpha.33 → 0.1.0-alpha.34
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/CHANGELOG.md +7 -0
- package/package.json +3 -3
- package/specs/special-words/main.tsp +48 -42
package/CHANGELOG.md
CHANGED
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.
|
|
4
|
+
"version": "0.1.0-alpha.34",
|
|
5
5
|
"description": "Spec scenarios and mock apis",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"type": "module",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"homepage": "https://github.com/microsoft/typespec#readme",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"deep-equal": "^2.2.0",
|
|
26
|
-
"@typespec/
|
|
27
|
-
"@typespec/
|
|
26
|
+
"@typespec/spec-api": "^0.1.0-alpha.13",
|
|
27
|
+
"@typespec/spector": "^0.1.0-alpha.24"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/deep-equal": "^1.0.1",
|
|
@@ -290,51 +290,51 @@ namespace ModelProperties {
|
|
|
290
290
|
op withList(@body body: ModelWithList): void;
|
|
291
291
|
}
|
|
292
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
293
|
/**
|
|
334
294
|
* Verify enum member names that are special words.
|
|
335
295
|
*/
|
|
336
296
|
@route("/extensible-strings")
|
|
337
|
-
|
|
297
|
+
namespace ExtensibleStrings {
|
|
298
|
+
/**
|
|
299
|
+
* Verify enum member names that are special words using extensible enum (union).
|
|
300
|
+
*/
|
|
301
|
+
union ExtensibleString {
|
|
302
|
+
string,
|
|
303
|
+
and: "and",
|
|
304
|
+
as: "as",
|
|
305
|
+
assert: "assert",
|
|
306
|
+
async: "async",
|
|
307
|
+
await: "await",
|
|
308
|
+
break: "break",
|
|
309
|
+
class: "class",
|
|
310
|
+
constructor: "constructor",
|
|
311
|
+
continue: "continue",
|
|
312
|
+
def: "def",
|
|
313
|
+
del: "del",
|
|
314
|
+
elif: "elif",
|
|
315
|
+
`else`: "else",
|
|
316
|
+
except: "except",
|
|
317
|
+
exec: "exec",
|
|
318
|
+
finally: "finally",
|
|
319
|
+
for: "for",
|
|
320
|
+
from: "from",
|
|
321
|
+
global: "global",
|
|
322
|
+
`if`: "if",
|
|
323
|
+
`import`: "import",
|
|
324
|
+
in: "in",
|
|
325
|
+
`is`: "is",
|
|
326
|
+
lambda: "lambda",
|
|
327
|
+
not: "not",
|
|
328
|
+
or: "or",
|
|
329
|
+
pass: "pass",
|
|
330
|
+
raise: "raise",
|
|
331
|
+
`return`: "return",
|
|
332
|
+
try: "try",
|
|
333
|
+
while: "while",
|
|
334
|
+
with: "with",
|
|
335
|
+
yield: "yield",
|
|
336
|
+
}
|
|
337
|
+
|
|
338
338
|
@scenario
|
|
339
339
|
@scenarioDoc("""
|
|
340
340
|
Verify that enum members with special word names can be sent and received properly.
|
|
@@ -342,5 +342,11 @@ interface ExtensibleStrings {
|
|
|
342
342
|
""")
|
|
343
343
|
@put
|
|
344
344
|
@route("/string")
|
|
345
|
-
putExtensibleStringValue(
|
|
345
|
+
op putExtensibleStringValue(
|
|
346
|
+
@header contentType: "application/json",
|
|
347
|
+
@body body: ExtensibleString,
|
|
348
|
+
): {
|
|
349
|
+
@header contentType: "application/json";
|
|
350
|
+
@body body: ExtensibleString;
|
|
351
|
+
};
|
|
346
352
|
}
|