@typespec/http-specs 0.37.2
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 +1 -0
- package/LICENSE +21 -0
- package/README.md +36 -0
- package/assets/image.jpg +0 -0
- package/assets/image.png +0 -0
- package/dist/specs/authentication/api-key/mockapi.d.ts +3 -0
- package/dist/specs/authentication/api-key/mockapi.d.ts.map +1 -0
- package/dist/specs/authentication/api-key/mockapi.js +45 -0
- package/dist/specs/authentication/api-key/mockapi.js.map +1 -0
- package/dist/specs/authentication/commonapi.d.ts +9 -0
- package/dist/specs/authentication/commonapi.d.ts.map +1 -0
- package/dist/specs/authentication/commonapi.js +19 -0
- package/dist/specs/authentication/commonapi.js.map +1 -0
- package/dist/specs/authentication/http/custom/mockapi.d.ts +3 -0
- package/dist/specs/authentication/http/custom/mockapi.d.ts.map +1 -0
- package/dist/specs/authentication/http/custom/mockapi.js +45 -0
- package/dist/specs/authentication/http/custom/mockapi.js.map +1 -0
- package/dist/specs/authentication/oauth2/mockapi.d.ts +3 -0
- package/dist/specs/authentication/oauth2/mockapi.d.ts.map +1 -0
- package/dist/specs/authentication/oauth2/mockapi.js +42 -0
- package/dist/specs/authentication/oauth2/mockapi.js.map +1 -0
- package/dist/specs/authentication/union/mockapi.d.ts +3 -0
- package/dist/specs/authentication/union/mockapi.d.ts.map +1 -0
- package/dist/specs/authentication/union/mockapi.js +37 -0
- package/dist/specs/authentication/union/mockapi.js.map +1 -0
- package/dist/specs/encode/bytes/mockapi.d.ts +3 -0
- package/dist/specs/encode/bytes/mockapi.d.ts.map +1 -0
- package/dist/specs/encode/bytes/mockapi.js +179 -0
- package/dist/specs/encode/bytes/mockapi.js.map +1 -0
- package/dist/specs/encode/datetime/mockapi.d.ts +3 -0
- package/dist/specs/encode/datetime/mockapi.d.ts.map +1 -0
- package/dist/specs/encode/datetime/mockapi.js +160 -0
- package/dist/specs/encode/datetime/mockapi.js.map +1 -0
- package/dist/specs/encode/duration/mockapi.d.ts +3 -0
- package/dist/specs/encode/duration/mockapi.d.ts.map +1 -0
- package/dist/specs/encode/duration/mockapi.js +116 -0
- package/dist/specs/encode/duration/mockapi.js.map +1 -0
- package/dist/specs/encode/numeric/mockapi.d.ts +3 -0
- package/dist/specs/encode/numeric/mockapi.d.ts.map +1 -0
- package/dist/specs/encode/numeric/mockapi.js +29 -0
- package/dist/specs/encode/numeric/mockapi.js.map +1 -0
- package/dist/specs/helper.d.ts +3 -0
- package/dist/specs/helper.d.ts.map +1 -0
- package/dist/specs/helper.js +7 -0
- package/dist/specs/helper.js.map +1 -0
- package/dist/specs/parameters/basic/mockapi.d.ts +3 -0
- package/dist/specs/parameters/basic/mockapi.d.ts.map +1 -0
- package/dist/specs/parameters/basic/mockapi.js +24 -0
- package/dist/specs/parameters/basic/mockapi.js.map +1 -0
- package/dist/specs/parameters/body-optionality/mockapi.d.ts +3 -0
- package/dist/specs/parameters/body-optionality/mockapi.d.ts.map +1 -0
- package/dist/specs/parameters/body-optionality/mockapi.js +62 -0
- package/dist/specs/parameters/body-optionality/mockapi.js.map +1 -0
- package/dist/specs/parameters/collection-format/mockapi.d.ts +3 -0
- package/dist/specs/parameters/collection-format/mockapi.d.ts.map +1 -0
- package/dist/specs/parameters/collection-format/mockapi.js +106 -0
- package/dist/specs/parameters/collection-format/mockapi.js.map +1 -0
- package/dist/specs/parameters/spread/mockapi.d.ts +3 -0
- package/dist/specs/parameters/spread/mockapi.d.ts.map +1 -0
- package/dist/specs/parameters/spread/mockapi.js +206 -0
- package/dist/specs/parameters/spread/mockapi.js.map +1 -0
- package/dist/specs/payload/json-merge-patch/mockapi.d.ts +40 -0
- package/dist/specs/payload/json-merge-patch/mockapi.d.ts.map +1 -0
- package/dist/specs/payload/json-merge-patch/mockapi.js +141 -0
- package/dist/specs/payload/json-merge-patch/mockapi.js.map +1 -0
- package/dist/specs/payload/media-type/mockapi.d.ts +3 -0
- package/dist/specs/payload/media-type/mockapi.d.ts.map +1 -0
- package/dist/specs/payload/media-type/mockapi.js +84 -0
- package/dist/specs/payload/media-type/mockapi.js.map +1 -0
- package/dist/specs/payload/multipart/mockapi.d.ts +3 -0
- package/dist/specs/payload/multipart/mockapi.d.ts.map +1 -0
- package/dist/specs/payload/multipart/mockapi.js +153 -0
- package/dist/specs/payload/multipart/mockapi.js.map +1 -0
- package/dist/specs/payload/xml/mockapi.d.ts +15 -0
- package/dist/specs/payload/xml/mockapi.d.ts.map +1 -0
- package/dist/specs/payload/xml/mockapi.js +189 -0
- package/dist/specs/payload/xml/mockapi.js.map +1 -0
- package/dist/specs/routes/mockapi.d.ts +3 -0
- package/dist/specs/routes/mockapi.d.ts.map +1 -0
- package/dist/specs/routes/mockapi.js +63 -0
- package/dist/specs/routes/mockapi.js.map +1 -0
- package/dist/specs/serialization/encoded-name/json/mockapi.d.ts +3 -0
- package/dist/specs/serialization/encoded-name/json/mockapi.d.ts.map +1 -0
- package/dist/specs/serialization/encoded-name/json/mockapi.js +32 -0
- package/dist/specs/serialization/encoded-name/json/mockapi.js.map +1 -0
- package/dist/specs/server/endpoint/not-defined/mockapi.d.ts +3 -0
- package/dist/specs/server/endpoint/not-defined/mockapi.d.ts.map +1 -0
- package/dist/specs/server/endpoint/not-defined/mockapi.js +15 -0
- package/dist/specs/server/endpoint/not-defined/mockapi.js.map +1 -0
- package/dist/specs/server/path/multiple/mockapi.d.ts +3 -0
- package/dist/specs/server/path/multiple/mockapi.d.ts.map +1 -0
- package/dist/specs/server/path/multiple/mockapi.js +27 -0
- package/dist/specs/server/path/multiple/mockapi.js.map +1 -0
- package/dist/specs/server/path/single/mockapi.d.ts +3 -0
- package/dist/specs/server/path/single/mockapi.d.ts.map +1 -0
- package/dist/specs/server/path/single/mockapi.js +15 -0
- package/dist/specs/server/path/single/mockapi.js.map +1 -0
- package/dist/specs/server/versions/not-versioned/mockapi.d.ts +3 -0
- package/dist/specs/server/versions/not-versioned/mockapi.d.ts.map +1 -0
- package/dist/specs/server/versions/not-versioned/mockapi.js +46 -0
- package/dist/specs/server/versions/not-versioned/mockapi.js.map +1 -0
- package/dist/specs/server/versions/versioned/mockapi.d.ts +3 -0
- package/dist/specs/server/versions/versioned/mockapi.d.ts.map +1 -0
- package/dist/specs/server/versions/versioned/mockapi.js +47 -0
- package/dist/specs/server/versions/versioned/mockapi.js.map +1 -0
- package/dist/specs/special-headers/conditional-request/mockapi.d.ts +3 -0
- package/dist/specs/special-headers/conditional-request/mockapi.d.ts.map +1 -0
- package/dist/specs/special-headers/conditional-request/mockapi.js +79 -0
- package/dist/specs/special-headers/conditional-request/mockapi.js.map +1 -0
- package/dist/specs/special-headers/repeatability/mockapi.d.ts +3 -0
- package/dist/specs/special-headers/repeatability/mockapi.d.ts.map +1 -0
- package/dist/specs/special-headers/repeatability/mockapi.js +36 -0
- package/dist/specs/special-headers/repeatability/mockapi.js.map +1 -0
- package/dist/specs/special-words/dec.d.ts +22 -0
- package/dist/specs/special-words/dec.d.ts.map +1 -0
- package/dist/specs/special-words/dec.js +37 -0
- package/dist/specs/special-words/dec.js.map +1 -0
- package/dist/specs/special-words/mockapi.d.ts +3 -0
- package/dist/specs/special-words/mockapi.d.ts.map +1 -0
- package/dist/specs/special-words/mockapi.js +246 -0
- package/dist/specs/special-words/mockapi.js.map +1 -0
- package/dist/specs/type/array/mockapi.d.ts +3 -0
- package/dist/specs/type/array/mockapi.d.ts.map +1 -0
- package/dist/specs/type/array/mockapi.js +104 -0
- package/dist/specs/type/array/mockapi.js.map +1 -0
- package/dist/specs/type/dictionary/mockapi.d.ts +3 -0
- package/dist/specs/type/dictionary/mockapi.d.ts.map +1 -0
- package/dist/specs/type/dictionary/mockapi.js +103 -0
- package/dist/specs/type/dictionary/mockapi.js.map +1 -0
- package/dist/specs/type/enum/extensible/mockapi.d.ts +3 -0
- package/dist/specs/type/enum/extensible/mockapi.d.ts.map +1 -0
- package/dist/specs/type/enum/extensible/mockapi.js +46 -0
- package/dist/specs/type/enum/extensible/mockapi.js.map +1 -0
- package/dist/specs/type/enum/fixed/mockapi.d.ts +3 -0
- package/dist/specs/type/enum/fixed/mockapi.d.ts.map +1 -0
- package/dist/specs/type/enum/fixed/mockapi.js +53 -0
- package/dist/specs/type/enum/fixed/mockapi.js.map +1 -0
- package/dist/specs/type/model/empty/mockapi.d.ts +3 -0
- package/dist/specs/type/model/empty/mockapi.d.ts.map +1 -0
- package/dist/specs/type/model/empty/mockapi.js +48 -0
- package/dist/specs/type/model/empty/mockapi.js.map +1 -0
- package/dist/specs/type/model/inheritance/enum-discriminator/mockapi.d.ts +3 -0
- package/dist/specs/type/model/inheritance/enum-discriminator/mockapi.d.ts.map +1 -0
- package/dist/specs/type/model/inheritance/enum-discriminator/mockapi.js +79 -0
- package/dist/specs/type/model/inheritance/enum-discriminator/mockapi.js.map +1 -0
- package/dist/specs/type/model/inheritance/nested-discriminator/mockapi.d.ts +3 -0
- package/dist/specs/type/model/inheritance/nested-discriminator/mockapi.d.ts.map +1 -0
- package/dist/specs/type/model/inheritance/nested-discriminator/mockapi.js +147 -0
- package/dist/specs/type/model/inheritance/nested-discriminator/mockapi.js.map +1 -0
- package/dist/specs/type/model/inheritance/not-discriminated/mockapi.d.ts +3 -0
- package/dist/specs/type/model/inheritance/not-discriminated/mockapi.d.ts.map +1 -0
- package/dist/specs/type/model/inheritance/not-discriminated/mockapi.js +47 -0
- package/dist/specs/type/model/inheritance/not-discriminated/mockapi.js.map +1 -0
- package/dist/specs/type/model/inheritance/recursive/mockapi.d.ts +3 -0
- package/dist/specs/type/model/inheritance/recursive/mockapi.d.ts.map +1 -0
- package/dist/specs/type/model/inheritance/recursive/mockapi.js +47 -0
- package/dist/specs/type/model/inheritance/recursive/mockapi.js.map +1 -0
- package/dist/specs/type/model/inheritance/single-discriminator/mockapi.d.ts +3 -0
- package/dist/specs/type/model/inheritance/single-discriminator/mockapi.d.ts.map +1 -0
- package/dist/specs/type/model/inheritance/single-discriminator/mockapi.js +122 -0
- package/dist/specs/type/model/inheritance/single-discriminator/mockapi.js.map +1 -0
- package/dist/specs/type/model/templated/mockapi.d.ts +3 -0
- package/dist/specs/type/model/templated/mockapi.d.ts.map +1 -0
- package/dist/specs/type/model/templated/mockapi.js +99 -0
- package/dist/specs/type/model/templated/mockapi.js.map +1 -0
- package/dist/specs/type/model/usage/mockapi.d.ts +3 -0
- package/dist/specs/type/model/usage/mockapi.d.ts.map +1 -0
- package/dist/specs/type/model/usage/mockapi.js +52 -0
- package/dist/specs/type/model/usage/mockapi.js.map +1 -0
- package/dist/specs/type/model/visibility/mockapi.d.ts +3 -0
- package/dist/specs/type/model/visibility/mockapi.d.ts.map +1 -0
- package/dist/specs/type/model/visibility/mockapi.js +138 -0
- package/dist/specs/type/model/visibility/mockapi.js.map +1 -0
- package/dist/specs/type/property/additional-properties/mockapi.d.ts +3 -0
- package/dist/specs/type/property/additional-properties/mockapi.d.ts.map +1 -0
- package/dist/specs/type/property/additional-properties/mockapi.js +346 -0
- package/dist/specs/type/property/additional-properties/mockapi.js.map +1 -0
- package/dist/specs/type/property/nullable/mockapi.d.ts +3 -0
- package/dist/specs/type/property/nullable/mockapi.d.ts.map +1 -0
- package/dist/specs/type/property/nullable/mockapi.js +147 -0
- package/dist/specs/type/property/nullable/mockapi.js.map +1 -0
- package/dist/specs/type/property/optionality/mockapi.d.ts +3 -0
- package/dist/specs/type/property/optionality/mockapi.d.ts.map +1 -0
- package/dist/specs/type/property/optionality/mockapi.js +197 -0
- package/dist/specs/type/property/optionality/mockapi.js.map +1 -0
- package/dist/specs/type/property/value-types/mockapi.d.ts +3 -0
- package/dist/specs/type/property/value-types/mockapi.d.ts.map +1 -0
- package/dist/specs/type/property/value-types/mockapi.js +213 -0
- package/dist/specs/type/property/value-types/mockapi.js.map +1 -0
- package/dist/specs/type/scalar/mockapi.d.ts +3 -0
- package/dist/specs/type/scalar/mockapi.d.ts.map +1 -0
- package/dist/specs/type/scalar/mockapi.js +274 -0
- package/dist/specs/type/scalar/mockapi.js.map +1 -0
- package/dist/specs/type/union/mockapi.d.ts +3 -0
- package/dist/specs/type/union/mockapi.d.ts.map +1 -0
- package/dist/specs/type/union/mockapi.js +113 -0
- package/dist/specs/type/union/mockapi.js.map +1 -0
- package/dist/specs/versioning/added/mockapi.d.ts +3 -0
- package/dist/specs/versioning/added/mockapi.d.ts.map +1 -0
- package/dist/specs/versioning/added/mockapi.js +76 -0
- package/dist/specs/versioning/added/mockapi.js.map +1 -0
- package/dist/specs/versioning/madeOptional/mockapi.d.ts +3 -0
- package/dist/specs/versioning/madeOptional/mockapi.d.ts.map +1 -0
- package/dist/specs/versioning/madeOptional/mockapi.js +24 -0
- package/dist/specs/versioning/madeOptional/mockapi.js.map +1 -0
- package/dist/specs/versioning/removed/mockapi.d.ts +3 -0
- package/dist/specs/versioning/removed/mockapi.d.ts.map +1 -0
- package/dist/specs/versioning/removed/mockapi.js +26 -0
- package/dist/specs/versioning/removed/mockapi.js.map +1 -0
- package/dist/specs/versioning/renamedFrom/mockapi.d.ts +3 -0
- package/dist/specs/versioning/renamedFrom/mockapi.d.ts.map +1 -0
- package/dist/specs/versioning/renamedFrom/mockapi.js +53 -0
- package/dist/specs/versioning/renamedFrom/mockapi.js.map +1 -0
- package/dist/specs/versioning/returnTypeChangedFrom/mockapi.d.ts +3 -0
- package/dist/specs/versioning/returnTypeChangedFrom/mockapi.d.ts.map +1 -0
- package/dist/specs/versioning/returnTypeChangedFrom/mockapi.js +25 -0
- package/dist/specs/versioning/returnTypeChangedFrom/mockapi.js.map +1 -0
- package/dist/specs/versioning/typeChangedFrom/mockapi.d.ts +3 -0
- package/dist/specs/versioning/typeChangedFrom/mockapi.d.ts.map +1 -0
- package/dist/specs/versioning/typeChangedFrom/mockapi.js +29 -0
- package/dist/specs/versioning/typeChangedFrom/mockapi.js.map +1 -0
- package/package.json +53 -0
- package/specs/README.md +3 -0
- package/specs/authentication/api-key/main.tsp +39 -0
- package/specs/authentication/api-key/mockapi.ts +47 -0
- package/specs/authentication/commonapi.ts +43 -0
- package/specs/authentication/http/custom/main.tsp +39 -0
- package/specs/authentication/http/custom/mockapi.ts +47 -0
- package/specs/authentication/oauth2/main.tsp +44 -0
- package/specs/authentication/oauth2/mockapi.ts +44 -0
- package/specs/authentication/union/main.tsp +29 -0
- package/specs/authentication/union/mockapi.ts +39 -0
- package/specs/encode/bytes/main.tsp +369 -0
- package/specs/encode/bytes/mockapi.ts +309 -0
- package/specs/encode/datetime/main.tsp +344 -0
- package/specs/encode/datetime/mockapi.ts +274 -0
- package/specs/encode/duration/main.tsp +322 -0
- package/specs/encode/duration/mockapi.ts +204 -0
- package/specs/encode/numeric/main.tsp +71 -0
- package/specs/encode/numeric/mockapi.ts +39 -0
- package/specs/helper.ts +8 -0
- package/specs/parameters/basic/main.tsp +61 -0
- package/specs/parameters/basic/mockapi.ts +29 -0
- package/specs/parameters/body-optionality/main.tsp +63 -0
- package/specs/parameters/body-optionality/mockapi.ts +71 -0
- package/specs/parameters/collection-format/main.tsp +95 -0
- package/specs/parameters/collection-format/mockapi.ts +113 -0
- package/specs/parameters/spread/main.tsp +340 -0
- package/specs/parameters/spread/mockapi.ts +216 -0
- package/specs/payload/json-merge-patch/main.tsp +183 -0
- package/specs/payload/json-merge-patch/mockapi.ts +146 -0
- package/specs/payload/media-type/main.tsp +54 -0
- package/specs/payload/media-type/mockapi.ts +88 -0
- package/specs/payload/multipart/main.tsp +499 -0
- package/specs/payload/multipart/mockapi.ts +226 -0
- package/specs/payload/xml/main.tsp +312 -0
- package/specs/payload/xml/mockapi.ts +244 -0
- package/specs/routes/main.tsp +476 -0
- package/specs/routes/mockapi.ts +158 -0
- package/specs/scratch/.gitignore +3 -0
- package/specs/serialization/encoded-name/json/main.tsp +45 -0
- package/specs/serialization/encoded-name/json/mockapi.ts +34 -0
- package/specs/server/endpoint/not-defined/main.tsp +19 -0
- package/specs/server/endpoint/not-defined/mockapi.ts +16 -0
- package/specs/server/path/multiple/main.tsp +46 -0
- package/specs/server/path/multiple/mockapi.ts +29 -0
- package/specs/server/path/single/main.tsp +23 -0
- package/specs/server/path/single/mockapi.ts +16 -0
- package/specs/server/versions/not-versioned/main.tsp +39 -0
- package/specs/server/versions/not-versioned/mockapi.ts +55 -0
- package/specs/server/versions/versioned/main.tsp +65 -0
- package/specs/server/versions/versioned/mockapi.ts +68 -0
- package/specs/special-headers/conditional-request/main.tsp +89 -0
- package/specs/special-headers/conditional-request/mockapi.ts +83 -0
- package/specs/special-headers/repeatability/main.tsp +39 -0
- package/specs/special-headers/repeatability/mockapi.ts +47 -0
- package/specs/special-words/dec.js +52 -0
- package/specs/special-words/main.tsp +238 -0
- package/specs/special-words/mockapi.ts +407 -0
- package/specs/type/array/main.tsp +132 -0
- package/specs/type/array/mockapi.ts +119 -0
- package/specs/type/dictionary/main.tsp +122 -0
- package/specs/type/dictionary/mockapi.ts +115 -0
- package/specs/type/enum/extensible/main.tsp +64 -0
- package/specs/type/enum/extensible/mockapi.ts +55 -0
- package/specs/type/enum/fixed/main.tsp +60 -0
- package/specs/type/enum/fixed/mockapi.ts +55 -0
- package/specs/type/model/empty/main.tsp +39 -0
- package/specs/type/model/empty/mockapi.ts +51 -0
- package/specs/type/model/inheritance/enum-discriminator/main.tsp +169 -0
- package/specs/type/model/inheritance/enum-discriminator/mockapi.ts +99 -0
- package/specs/type/model/inheritance/nested-discriminator/main.tsp +223 -0
- package/specs/type/model/inheritance/nested-discriminator/mockapi.ts +150 -0
- package/specs/type/model/inheritance/not-discriminated/main.tsp +53 -0
- package/specs/type/model/inheritance/not-discriminated/mockapi.ts +49 -0
- package/specs/type/model/inheritance/recursive/main.tsp +70 -0
- package/specs/type/model/inheritance/recursive/mockapi.ts +48 -0
- package/specs/type/model/inheritance/single-discriminator/main.tsp +171 -0
- package/specs/type/model/inheritance/single-discriminator/mockapi.ts +126 -0
- package/specs/type/model/templated/main.tsp +130 -0
- package/specs/type/model/templated/mockapi.ts +102 -0
- package/specs/type/model/usage/main.tsp +48 -0
- package/specs/type/model/usage/mockapi.ts +56 -0
- package/specs/type/model/visibility/main.tsp +152 -0
- package/specs/type/model/visibility/mockapi.ts +139 -0
- package/specs/type/property/additional-properties/main.tsp +591 -0
- package/specs/type/property/additional-properties/mockapi.ts +477 -0
- package/specs/type/property/nullable/client.tsp +21 -0
- package/specs/type/property/nullable/main.tsp +162 -0
- package/specs/type/property/nullable/mockapi.ts +202 -0
- package/specs/type/property/optionality/main.tsp +258 -0
- package/specs/type/property/optionality/mockapi.ts +308 -0
- package/specs/type/property/value-types/main.tsp +285 -0
- package/specs/type/property/value-types/mockapi.ts +297 -0
- package/specs/type/scalar/main.tsp +164 -0
- package/specs/type/scalar/mockapi.ts +280 -0
- package/specs/type/union/main.tsp +262 -0
- package/specs/type/union/mockapi.ts +137 -0
- package/specs/versioning/added/main.tsp +135 -0
- package/specs/versioning/added/mockapi.ts +79 -0
- package/specs/versioning/madeOptional/main.tsp +64 -0
- package/specs/versioning/madeOptional/mockapi.ts +25 -0
- package/specs/versioning/removed/main.tsp +125 -0
- package/specs/versioning/removed/mockapi.ts +27 -0
- package/specs/versioning/renamedFrom/main.tsp +111 -0
- package/specs/versioning/renamedFrom/mockapi.ts +55 -0
- package/specs/versioning/returnTypeChangedFrom/main.tsp +56 -0
- package/specs/versioning/returnTypeChangedFrom/mockapi.ts +26 -0
- package/specs/versioning/typeChangedFrom/main.tsp +70 -0
- package/specs/versioning/typeChangedFrom/mockapi.ts +30 -0
- package/temp/.tsbuildinfo +1 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.json +11 -0
- package/tspconfig.yaml +2 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import { $route } from "@typespec/http";
|
|
4
|
+
import { $scenario, $scenarioDoc } from "@typespec/spec-lib";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param {*} context
|
|
9
|
+
* @param {*} target
|
|
10
|
+
* @param {*} name
|
|
11
|
+
*/
|
|
12
|
+
export function $opNameScenario(context, target, name) {
|
|
13
|
+
context.call($scenario, target, name.value);
|
|
14
|
+
context.call(
|
|
15
|
+
$scenarioDoc,
|
|
16
|
+
target,
|
|
17
|
+
`Verify that the name "${name.value}" works as an operation name. Call this operation to pass.`,
|
|
18
|
+
);
|
|
19
|
+
context.call($route, target, `/${name.value}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {*} context
|
|
25
|
+
* @param {*} target
|
|
26
|
+
* @param {*} name
|
|
27
|
+
*/
|
|
28
|
+
export function $paramNameScenario(context, target, name) {
|
|
29
|
+
context.call($scenario, target, name.value);
|
|
30
|
+
context.call(
|
|
31
|
+
$scenarioDoc,
|
|
32
|
+
target,
|
|
33
|
+
`Verify that the name "${name.value}" works. Send this parameter to pass with value \`ok\`.`,
|
|
34
|
+
);
|
|
35
|
+
context.call($route, target, `/${name.value}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @param {*} context
|
|
41
|
+
* @param {*} target
|
|
42
|
+
* @param {*} name
|
|
43
|
+
*/
|
|
44
|
+
export function $modelNameScenario(context, target, name) {
|
|
45
|
+
context.call($scenario, target, name.value);
|
|
46
|
+
context.call(
|
|
47
|
+
$scenarioDoc,
|
|
48
|
+
target,
|
|
49
|
+
`Verify that the name "${name.value}" works. Send\n\`\`\`json\n{"name": "ok"}\n\`\`\` `,
|
|
50
|
+
);
|
|
51
|
+
context.call($route, target, `/${name.value}`);
|
|
52
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import "@typespec/http";
|
|
2
|
+
import "@typespec/spec-lib";
|
|
3
|
+
import "./dec.js";
|
|
4
|
+
|
|
5
|
+
using TypeSpec.Http;
|
|
6
|
+
using Azure.ClientGenerator.Core;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Scenarios to verify that reserved words can be used in service and generators will handle it appropriately.
|
|
10
|
+
*
|
|
11
|
+
* Current list of special words
|
|
12
|
+
* ```txt
|
|
13
|
+
* and
|
|
14
|
+
* as
|
|
15
|
+
* assert
|
|
16
|
+
* async
|
|
17
|
+
* await
|
|
18
|
+
* break
|
|
19
|
+
* class
|
|
20
|
+
* constructor
|
|
21
|
+
* continue
|
|
22
|
+
* def
|
|
23
|
+
* del
|
|
24
|
+
* elif
|
|
25
|
+
* else
|
|
26
|
+
* except
|
|
27
|
+
* exec
|
|
28
|
+
* finally
|
|
29
|
+
* for
|
|
30
|
+
* from
|
|
31
|
+
* global
|
|
32
|
+
* if
|
|
33
|
+
* import
|
|
34
|
+
* in
|
|
35
|
+
* is
|
|
36
|
+
* lambda
|
|
37
|
+
* not
|
|
38
|
+
* or
|
|
39
|
+
* pass
|
|
40
|
+
* raise
|
|
41
|
+
* return
|
|
42
|
+
* try
|
|
43
|
+
* while
|
|
44
|
+
* with
|
|
45
|
+
* yield
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
@scenarioService("/special-words")
|
|
49
|
+
namespace SpecialWords;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Test reserved words as operation name.
|
|
53
|
+
*/
|
|
54
|
+
@route("/operations")
|
|
55
|
+
@operationGroup
|
|
56
|
+
interface Operations {
|
|
57
|
+
@opNameScenario("and") and(): void;
|
|
58
|
+
@opNameScenario("as") as(): void;
|
|
59
|
+
@opNameScenario("assert") assert(): void;
|
|
60
|
+
@opNameScenario("async") async(): void;
|
|
61
|
+
@opNameScenario("await") await(): void;
|
|
62
|
+
@opNameScenario("break") break(): void;
|
|
63
|
+
@opNameScenario("class") class(): void;
|
|
64
|
+
@opNameScenario("constructor") constructor(): void;
|
|
65
|
+
@opNameScenario("continue") continue(): void;
|
|
66
|
+
@opNameScenario("def") def(): void;
|
|
67
|
+
@opNameScenario("del") del(): void;
|
|
68
|
+
@opNameScenario("elif") elif(): void;
|
|
69
|
+
@opNameScenario("else") `else`(): void;
|
|
70
|
+
@opNameScenario("except") except(): void;
|
|
71
|
+
@opNameScenario("exec") exec(): void;
|
|
72
|
+
@opNameScenario("finally") finally(): void;
|
|
73
|
+
@opNameScenario("for") for(): void;
|
|
74
|
+
@opNameScenario("from") from(): void;
|
|
75
|
+
@opNameScenario("global") global(): void;
|
|
76
|
+
@opNameScenario("if") `if`(): void;
|
|
77
|
+
@opNameScenario("import") `import`(): void;
|
|
78
|
+
@opNameScenario("in") in(): void;
|
|
79
|
+
@opNameScenario("is") `is`(): void;
|
|
80
|
+
@opNameScenario("lambda") lambda(): void;
|
|
81
|
+
@opNameScenario("not") not(): void;
|
|
82
|
+
@opNameScenario("or") or(): void;
|
|
83
|
+
@opNameScenario("pass") pass(): void;
|
|
84
|
+
@opNameScenario("raise") raise(): void;
|
|
85
|
+
@opNameScenario("return") `return`(): void;
|
|
86
|
+
@opNameScenario("try") try(): void;
|
|
87
|
+
@opNameScenario("while") while(): void;
|
|
88
|
+
@opNameScenario("with") with(): void;
|
|
89
|
+
@opNameScenario("yield") yield(): void;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Verify reserved words as parameter name.
|
|
94
|
+
*/
|
|
95
|
+
@route("/parameters")
|
|
96
|
+
@operationGroup
|
|
97
|
+
interface Parameters {
|
|
98
|
+
@paramNameScenario("and") withAnd(@query and: string): void;
|
|
99
|
+
@paramNameScenario("as") withAs(@query as: string): void;
|
|
100
|
+
@paramNameScenario("assert") withAssert(@query assert: string): void;
|
|
101
|
+
@paramNameScenario("async") withAsync(@query async: string): void;
|
|
102
|
+
@paramNameScenario("await") withAwait(@query await: string): void;
|
|
103
|
+
@paramNameScenario("break") withBreak(@query break: string): void;
|
|
104
|
+
@paramNameScenario("class") withClass(@query class: string): void;
|
|
105
|
+
@paramNameScenario("constructor") withConstructor(@query constructor: string): void;
|
|
106
|
+
@paramNameScenario("continue") withContinue(@query continue: string): void;
|
|
107
|
+
@paramNameScenario("def") withDef(@query def: string): void;
|
|
108
|
+
@paramNameScenario("del") withDel(@query del: string): void;
|
|
109
|
+
@paramNameScenario("elif") withElif(@query elif: string): void;
|
|
110
|
+
@paramNameScenario("else") withElse(@query `else`: string): void;
|
|
111
|
+
@paramNameScenario("except") withExcept(@query except: string): void;
|
|
112
|
+
@paramNameScenario("exec") withExec(@query exec: string): void;
|
|
113
|
+
@paramNameScenario("finally") withFinally(@query finally: string): void;
|
|
114
|
+
@paramNameScenario("for") withFor(@query for: string): void;
|
|
115
|
+
@paramNameScenario("from") withFrom(@query from: string): void;
|
|
116
|
+
@paramNameScenario("global") withGlobal(@query global: string): void;
|
|
117
|
+
@paramNameScenario("if") withIf(@query `if`: string): void;
|
|
118
|
+
@paramNameScenario("import") withImport(@query `import`: string): void;
|
|
119
|
+
@paramNameScenario("in") withIn(@query in: string): void;
|
|
120
|
+
@paramNameScenario("is") withIs(@query `is`: string): void;
|
|
121
|
+
@paramNameScenario("lambda") withLambda(@query lambda: string): void;
|
|
122
|
+
@paramNameScenario("not") withNot(@query not: string): void;
|
|
123
|
+
@paramNameScenario("or") withOr(@query or: string): void;
|
|
124
|
+
@paramNameScenario("pass") withPass(@query pass: string): void;
|
|
125
|
+
@paramNameScenario("raise") withRaise(@query raise: string): void;
|
|
126
|
+
@paramNameScenario("return") withReturn(@query `return`: string): void;
|
|
127
|
+
@paramNameScenario("try") withTry(@query try: string): void;
|
|
128
|
+
@paramNameScenario("while") withWhile(@query while: string): void;
|
|
129
|
+
@paramNameScenario("with") withWith(@query with: string): void;
|
|
130
|
+
@paramNameScenario("yield") withYield(@query yield: string): void;
|
|
131
|
+
|
|
132
|
+
// Non keywords but parameters name that could cause conflict with some language standards
|
|
133
|
+
@paramNameScenario("cancellationToken") withCancellationToken(
|
|
134
|
+
@query cancellationToken: string,
|
|
135
|
+
): void;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Verify model names
|
|
140
|
+
*/
|
|
141
|
+
@route("/models")
|
|
142
|
+
@operationGroup
|
|
143
|
+
namespace Models {
|
|
144
|
+
model Base {
|
|
145
|
+
name: string;
|
|
146
|
+
}
|
|
147
|
+
model and is Base;
|
|
148
|
+
model as is Base;
|
|
149
|
+
model assert is Base;
|
|
150
|
+
model async is Base;
|
|
151
|
+
model await is Base;
|
|
152
|
+
model break is Base;
|
|
153
|
+
model class is Base;
|
|
154
|
+
model continue is Base;
|
|
155
|
+
model constructor is Base;
|
|
156
|
+
model def is Base;
|
|
157
|
+
model del is Base;
|
|
158
|
+
model elif is Base;
|
|
159
|
+
model `else` is Base;
|
|
160
|
+
model except is Base;
|
|
161
|
+
model exec is Base;
|
|
162
|
+
model finally is Base;
|
|
163
|
+
model for is Base;
|
|
164
|
+
model from is Base;
|
|
165
|
+
model global is Base;
|
|
166
|
+
model `if` is Base;
|
|
167
|
+
model `import` is Base;
|
|
168
|
+
model in is Base;
|
|
169
|
+
model `is` is Base;
|
|
170
|
+
model lambda is Base;
|
|
171
|
+
model not is Base;
|
|
172
|
+
model or is Base;
|
|
173
|
+
model pass is Base;
|
|
174
|
+
model raise is Base;
|
|
175
|
+
model `return` is Base;
|
|
176
|
+
model try is Base;
|
|
177
|
+
model while is Base;
|
|
178
|
+
model with is Base;
|
|
179
|
+
model yield is Base;
|
|
180
|
+
|
|
181
|
+
@modelNameScenario("and") op withAnd(@body body: and): void;
|
|
182
|
+
@modelNameScenario("as") op withAs(@body body: as): void;
|
|
183
|
+
@modelNameScenario("assert") op withAssert(@body body: assert): void;
|
|
184
|
+
@modelNameScenario("async") op withAsync(@body body: async): void;
|
|
185
|
+
@modelNameScenario("await") op withAwait(@body body: await): void;
|
|
186
|
+
@modelNameScenario("break") op withBreak(@body body: break): void;
|
|
187
|
+
@modelNameScenario("class") op withClass(@body body: class): void;
|
|
188
|
+
@modelNameScenario("constructor") op withConstructor(@body body: constructor): void;
|
|
189
|
+
@modelNameScenario("continue") op withContinue(@body body: continue): void;
|
|
190
|
+
@modelNameScenario("def") op withDef(@body body: def): void;
|
|
191
|
+
@modelNameScenario("del") op withDel(@body body: del): void;
|
|
192
|
+
@modelNameScenario("elif") op withElif(@body body: elif): void;
|
|
193
|
+
@modelNameScenario("else") op withElse(@body body: `else`): void;
|
|
194
|
+
@modelNameScenario("except") op withExcept(@body body: except): void;
|
|
195
|
+
@modelNameScenario("exec") op withExec(@body body: exec): void;
|
|
196
|
+
@modelNameScenario("finally") op withFinally(@body body: finally): void;
|
|
197
|
+
@modelNameScenario("for") op withFor(@body body: for): void;
|
|
198
|
+
@modelNameScenario("from") op withFrom(@body body: from): void;
|
|
199
|
+
@modelNameScenario("global") op withGlobal(@body body: global): void;
|
|
200
|
+
@modelNameScenario("if") op withIf(@body body: `if`): void;
|
|
201
|
+
@modelNameScenario("import") op withImport(@body body: `import`): void;
|
|
202
|
+
@modelNameScenario("in") op withIn(@body body: in): void;
|
|
203
|
+
@modelNameScenario("is") op withIs(@body body: `is`): void;
|
|
204
|
+
@modelNameScenario("lambda") op withLambda(@body body: lambda): void;
|
|
205
|
+
@modelNameScenario("not") op withNot(@body body: not): void;
|
|
206
|
+
@modelNameScenario("or") op withOr(@body body: or): void;
|
|
207
|
+
@modelNameScenario("pass") op withPass(@body body: pass): void;
|
|
208
|
+
@modelNameScenario("raise") op withRaise(@body body: raise): void;
|
|
209
|
+
@modelNameScenario("return") op withReturn(@body body: `return`): void;
|
|
210
|
+
@modelNameScenario("try") op withTry(@body body: try): void;
|
|
211
|
+
@modelNameScenario("while") op withWhile(@body body: while): void;
|
|
212
|
+
@modelNameScenario("with") op withWith(@body body: with): void;
|
|
213
|
+
@modelNameScenario("yield") op withYield(@body body: yield): void;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Verify model names
|
|
218
|
+
*/
|
|
219
|
+
@route("/model-properties")
|
|
220
|
+
@operationGroup
|
|
221
|
+
namespace ModelProperties {
|
|
222
|
+
model SameAsModel {
|
|
223
|
+
SameAsModel: string;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@scenario
|
|
227
|
+
@scenarioDoc("""
|
|
228
|
+
Verify that a property can be called the same as the model name. This can be an issue in some languages where the class name is the constructor.
|
|
229
|
+
|
|
230
|
+
Send
|
|
231
|
+
|
|
232
|
+
```json
|
|
233
|
+
{"SameAsModel": "ok"}
|
|
234
|
+
```
|
|
235
|
+
""")
|
|
236
|
+
@route("same-as-model")
|
|
237
|
+
op sameAsModel(@body body: SameAsModel): void;
|
|
238
|
+
}
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import { MockRequest, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api";
|
|
2
|
+
|
|
3
|
+
export const Scenarios: Record<string, ScenarioMockApi> = {};
|
|
4
|
+
|
|
5
|
+
Scenarios.Special_Words_Model_Properties_Same_As_Model = passOnSuccess({
|
|
6
|
+
uri: "/special-words/model-properties/same-as-model",
|
|
7
|
+
method: "post",
|
|
8
|
+
request: {
|
|
9
|
+
body: {
|
|
10
|
+
SameAsModel: "ok",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
response: {
|
|
14
|
+
status: 204,
|
|
15
|
+
},
|
|
16
|
+
handler: (req: MockRequest) => {
|
|
17
|
+
req.expect.bodyEquals({ ["SameAsModel"]: "ok" });
|
|
18
|
+
return {
|
|
19
|
+
status: 204,
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
kind: "MockApiDefinition",
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
function createModelsTests(uri: string) {
|
|
26
|
+
return passOnSuccess({
|
|
27
|
+
uri,
|
|
28
|
+
method: "post",
|
|
29
|
+
request: {
|
|
30
|
+
body: {
|
|
31
|
+
name: "ok",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
response: {
|
|
35
|
+
status: 204,
|
|
36
|
+
},
|
|
37
|
+
handler: (req: MockRequest) => {
|
|
38
|
+
req.expect.bodyEquals({ name: "ok" });
|
|
39
|
+
return {
|
|
40
|
+
status: 204,
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
kind: "MockApiDefinition",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
Scenarios.SpecialWords_Models_and = createModelsTests(`/special-words/models/and`);
|
|
47
|
+
Scenarios.SpecialWords_Models_as = createModelsTests(`/special-words/models/as`);
|
|
48
|
+
Scenarios.SpecialWords_Models_assert = createModelsTests(`/special-words/models/assert`);
|
|
49
|
+
Scenarios.SpecialWords_Models_async = createModelsTests(`/special-words/models/async`);
|
|
50
|
+
Scenarios.SpecialWords_Models_await = createModelsTests(`/special-words/models/await`);
|
|
51
|
+
Scenarios.SpecialWords_Models_break = createModelsTests(`/special-words/models/break`);
|
|
52
|
+
Scenarios.SpecialWords_Models_class = createModelsTests(`/special-words/models/class`);
|
|
53
|
+
Scenarios.SpecialWords_Models_constructor = createModelsTests(`/special-words/models/constructor`);
|
|
54
|
+
Scenarios.SpecialWords_Models_continue = createModelsTests(`/special-words/models/continue`);
|
|
55
|
+
Scenarios.SpecialWords_Models_def = createModelsTests(`/special-words/models/def`);
|
|
56
|
+
Scenarios.SpecialWords_Models_del = createModelsTests(`/special-words/models/del`);
|
|
57
|
+
Scenarios.SpecialWords_Models_elif = createModelsTests(`/special-words/models/elif`);
|
|
58
|
+
Scenarios.SpecialWords_Models_else = createModelsTests(`/special-words/models/else`);
|
|
59
|
+
Scenarios.SpecialWords_Models_except = createModelsTests(`/special-words/models/except`);
|
|
60
|
+
Scenarios.SpecialWords_Models_exec = createModelsTests(`/special-words/models/exec`);
|
|
61
|
+
Scenarios.SpecialWords_Models_finally = createModelsTests(`/special-words/models/finally`);
|
|
62
|
+
Scenarios.SpecialWords_Models_for = createModelsTests(`/special-words/models/for`);
|
|
63
|
+
Scenarios.SpecialWords_Models_from = createModelsTests(`/special-words/models/from`);
|
|
64
|
+
Scenarios.SpecialWords_Models_global = createModelsTests(`/special-words/models/global`);
|
|
65
|
+
Scenarios.SpecialWords_Models_if = createModelsTests(`/special-words/models/if`);
|
|
66
|
+
Scenarios.SpecialWords_Models_import = createModelsTests(`/special-words/models/import`);
|
|
67
|
+
Scenarios.SpecialWords_Models_in = createModelsTests(`/special-words/models/in`);
|
|
68
|
+
Scenarios.SpecialWords_Models_is = createModelsTests(`/special-words/models/is`);
|
|
69
|
+
Scenarios.SpecialWords_Models_lambda = createModelsTests(`/special-words/models/lambda`);
|
|
70
|
+
Scenarios.SpecialWords_Models_not = createModelsTests(`/special-words/models/not`);
|
|
71
|
+
Scenarios.SpecialWords_Models_or = createModelsTests(`/special-words/models/or`);
|
|
72
|
+
Scenarios.SpecialWords_Models_pass = createModelsTests(`/special-words/models/pass`);
|
|
73
|
+
Scenarios.SpecialWords_Models_raise = createModelsTests(`/special-words/models/raise`);
|
|
74
|
+
Scenarios.SpecialWords_Models_return = createModelsTests(`/special-words/models/return`);
|
|
75
|
+
Scenarios.SpecialWords_Models_try = createModelsTests(`/special-words/models/try`);
|
|
76
|
+
Scenarios.SpecialWords_Models_while = createModelsTests(`/special-words/models/while`);
|
|
77
|
+
Scenarios.SpecialWords_Models_with = createModelsTests(`/special-words/models/with`);
|
|
78
|
+
Scenarios.SpecialWords_Models_yield = createModelsTests(`/special-words/models/yield`);
|
|
79
|
+
|
|
80
|
+
function createOperationsTests(uri: string) {
|
|
81
|
+
return passOnSuccess({
|
|
82
|
+
uri,
|
|
83
|
+
method: "get",
|
|
84
|
+
request: {},
|
|
85
|
+
response: {
|
|
86
|
+
status: 204,
|
|
87
|
+
},
|
|
88
|
+
handler: (req: MockRequest) => {
|
|
89
|
+
return {
|
|
90
|
+
status: 204,
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
kind: "MockApiDefinition",
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
Scenarios.SpecialWords_Operations_and = createOperationsTests(`/special-words/operations/and`);
|
|
98
|
+
Scenarios.SpecialWords_Operations_as = createOperationsTests(`/special-words/operations/as`);
|
|
99
|
+
Scenarios.SpecialWords_Operations_assert = createOperationsTests(
|
|
100
|
+
`/special-words/operations/assert`,
|
|
101
|
+
);
|
|
102
|
+
Scenarios.SpecialWords_Operations_async = createOperationsTests(`/special-words/operations/async`);
|
|
103
|
+
Scenarios.SpecialWords_Operations_await = createOperationsTests(`/special-words/operations/await`);
|
|
104
|
+
Scenarios.SpecialWords_Operations_break = createOperationsTests(`/special-words/operations/break`);
|
|
105
|
+
Scenarios.SpecialWords_Operations_class = createOperationsTests(`/special-words/operations/class`);
|
|
106
|
+
Scenarios.SpecialWords_Operations_constructor = createOperationsTests(
|
|
107
|
+
`/special-words/operations/constructor`,
|
|
108
|
+
);
|
|
109
|
+
Scenarios.SpecialWords_Operations_continue = createOperationsTests(
|
|
110
|
+
`/special-words/operations/continue`,
|
|
111
|
+
);
|
|
112
|
+
Scenarios.SpecialWords_Operations_def = createOperationsTests(`/special-words/operations/def`);
|
|
113
|
+
Scenarios.SpecialWords_Operations_del = createOperationsTests(`/special-words/operations/del`);
|
|
114
|
+
Scenarios.SpecialWords_Operations_elif = createOperationsTests(`/special-words/operations/elif`);
|
|
115
|
+
Scenarios.SpecialWords_Operations_else = createOperationsTests(`/special-words/operations/else`);
|
|
116
|
+
Scenarios.SpecialWords_Operations_except = createOperationsTests(
|
|
117
|
+
`/special-words/operations/except`,
|
|
118
|
+
);
|
|
119
|
+
Scenarios.SpecialWords_Operations_exec = createOperationsTests(`/special-words/operations/exec`);
|
|
120
|
+
Scenarios.SpecialWords_Operations_finally = createOperationsTests(
|
|
121
|
+
`/special-words/operations/finally`,
|
|
122
|
+
);
|
|
123
|
+
Scenarios.SpecialWords_Operations_for = createOperationsTests(`/special-words/operations/for`);
|
|
124
|
+
Scenarios.SpecialWords_Operations_from = createOperationsTests(`/special-words/operations/from`);
|
|
125
|
+
Scenarios.SpecialWords_Operations_global = createOperationsTests(
|
|
126
|
+
`/special-words/operations/global`,
|
|
127
|
+
);
|
|
128
|
+
Scenarios.SpecialWords_Operations_if = createOperationsTests(`/special-words/operations/if`);
|
|
129
|
+
Scenarios.SpecialWords_Operations_import = createOperationsTests(
|
|
130
|
+
`/special-words/operations/import`,
|
|
131
|
+
);
|
|
132
|
+
Scenarios.SpecialWords_Operations_in = createOperationsTests(`/special-words/operations/in`);
|
|
133
|
+
Scenarios.SpecialWords_Operations_is = createOperationsTests(`/special-words/operations/is`);
|
|
134
|
+
Scenarios.SpecialWords_Operations_lambda = createOperationsTests(
|
|
135
|
+
`/special-words/operations/lambda`,
|
|
136
|
+
);
|
|
137
|
+
Scenarios.SpecialWords_Operations_not = createOperationsTests(`/special-words/operations/not`);
|
|
138
|
+
Scenarios.SpecialWords_Operations_or = createOperationsTests(`/special-words/operations/or`);
|
|
139
|
+
Scenarios.SpecialWords_Operations_pass = createOperationsTests(`/special-words/operations/pass`);
|
|
140
|
+
Scenarios.SpecialWords_Operations_raise = createOperationsTests(`/special-words/operations/raise`);
|
|
141
|
+
Scenarios.SpecialWords_Operations_return = createOperationsTests(
|
|
142
|
+
`/special-words/operations/return`,
|
|
143
|
+
);
|
|
144
|
+
Scenarios.SpecialWords_Operations_try = createOperationsTests(`/special-words/operations/try`);
|
|
145
|
+
Scenarios.SpecialWords_Operations_while = createOperationsTests(`/special-words/operations/while`);
|
|
146
|
+
Scenarios.SpecialWords_Operations_with = createOperationsTests(`/special-words/operations/with`);
|
|
147
|
+
Scenarios.SpecialWords_Operations_yield = createOperationsTests(`/special-words/operations/yield`);
|
|
148
|
+
|
|
149
|
+
function createParametersTests(uri: string, data: any, paramName: string) {
|
|
150
|
+
return passOnSuccess({
|
|
151
|
+
uri,
|
|
152
|
+
method: "get",
|
|
153
|
+
request: {
|
|
154
|
+
params: data,
|
|
155
|
+
},
|
|
156
|
+
response: {
|
|
157
|
+
status: 204,
|
|
158
|
+
},
|
|
159
|
+
handler: (req: MockRequest) => {
|
|
160
|
+
req.expect.containsQueryParam(paramName, "ok");
|
|
161
|
+
return {
|
|
162
|
+
status: 204,
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
kind: "MockApiDefinition",
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
Scenarios.SpecialWords_Parameters_and = createParametersTests(
|
|
170
|
+
`/special-words/parameters/and`,
|
|
171
|
+
{
|
|
172
|
+
and: "ok",
|
|
173
|
+
},
|
|
174
|
+
"and",
|
|
175
|
+
);
|
|
176
|
+
Scenarios.SpecialWords_Parameters_as = createParametersTests(
|
|
177
|
+
`/special-words/parameters/as`,
|
|
178
|
+
{
|
|
179
|
+
as: "ok",
|
|
180
|
+
},
|
|
181
|
+
"as",
|
|
182
|
+
);
|
|
183
|
+
Scenarios.SpecialWords_Parameters_assert = createParametersTests(
|
|
184
|
+
`/special-words/parameters/assert`,
|
|
185
|
+
{
|
|
186
|
+
assert: "ok",
|
|
187
|
+
},
|
|
188
|
+
"assert",
|
|
189
|
+
);
|
|
190
|
+
Scenarios.SpecialWords_Parameters_async = createParametersTests(
|
|
191
|
+
`/special-words/parameters/async`,
|
|
192
|
+
{
|
|
193
|
+
async: "ok",
|
|
194
|
+
},
|
|
195
|
+
"async",
|
|
196
|
+
);
|
|
197
|
+
Scenarios.SpecialWords_Parameters_await = createParametersTests(
|
|
198
|
+
`/special-words/parameters/await`,
|
|
199
|
+
{
|
|
200
|
+
await: "ok",
|
|
201
|
+
},
|
|
202
|
+
"await",
|
|
203
|
+
);
|
|
204
|
+
Scenarios.SpecialWords_Parameters_break = createParametersTests(
|
|
205
|
+
`/special-words/parameters/break`,
|
|
206
|
+
{
|
|
207
|
+
break: "ok",
|
|
208
|
+
},
|
|
209
|
+
"break",
|
|
210
|
+
);
|
|
211
|
+
Scenarios.SpecialWords_Parameters_class = createParametersTests(
|
|
212
|
+
`/special-words/parameters/class`,
|
|
213
|
+
{
|
|
214
|
+
class: "ok",
|
|
215
|
+
},
|
|
216
|
+
"class",
|
|
217
|
+
);
|
|
218
|
+
Scenarios.SpecialWords_Parameters_constructor = createParametersTests(
|
|
219
|
+
`/special-words/parameters/constructor`,
|
|
220
|
+
{
|
|
221
|
+
constructor: "ok",
|
|
222
|
+
},
|
|
223
|
+
"constructor",
|
|
224
|
+
);
|
|
225
|
+
Scenarios.SpecialWords_Parameters_continue = createParametersTests(
|
|
226
|
+
`/special-words/parameters/continue`,
|
|
227
|
+
{
|
|
228
|
+
continue: "ok",
|
|
229
|
+
},
|
|
230
|
+
"continue",
|
|
231
|
+
);
|
|
232
|
+
Scenarios.SpecialWords_Parameters_def = createParametersTests(
|
|
233
|
+
`/special-words/parameters/def`,
|
|
234
|
+
{
|
|
235
|
+
def: "ok",
|
|
236
|
+
},
|
|
237
|
+
"def",
|
|
238
|
+
);
|
|
239
|
+
Scenarios.SpecialWords_Parameters_del = createParametersTests(
|
|
240
|
+
`/special-words/parameters/del`,
|
|
241
|
+
{
|
|
242
|
+
del: "ok",
|
|
243
|
+
},
|
|
244
|
+
"del",
|
|
245
|
+
);
|
|
246
|
+
Scenarios.SpecialWords_Parameters_elif = createParametersTests(
|
|
247
|
+
`/special-words/parameters/elif`,
|
|
248
|
+
{
|
|
249
|
+
elif: "ok",
|
|
250
|
+
},
|
|
251
|
+
"elif",
|
|
252
|
+
);
|
|
253
|
+
Scenarios.SpecialWords_Parameters_else = createParametersTests(
|
|
254
|
+
`/special-words/parameters/else`,
|
|
255
|
+
{
|
|
256
|
+
else: "ok",
|
|
257
|
+
},
|
|
258
|
+
"else",
|
|
259
|
+
);
|
|
260
|
+
Scenarios.SpecialWords_Parameters_except = createParametersTests(
|
|
261
|
+
`/special-words/parameters/except`,
|
|
262
|
+
{
|
|
263
|
+
except: "ok",
|
|
264
|
+
},
|
|
265
|
+
"except",
|
|
266
|
+
);
|
|
267
|
+
Scenarios.SpecialWords_Parameters_exec = createParametersTests(
|
|
268
|
+
`/special-words/parameters/exec`,
|
|
269
|
+
{
|
|
270
|
+
exec: "ok",
|
|
271
|
+
},
|
|
272
|
+
"exec",
|
|
273
|
+
);
|
|
274
|
+
Scenarios.SpecialWords_Parameters_finally = createParametersTests(
|
|
275
|
+
`/special-words/parameters/finally`,
|
|
276
|
+
{
|
|
277
|
+
finally: "ok",
|
|
278
|
+
},
|
|
279
|
+
"finally",
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
Scenarios.SpecialWords_Parameters_for = createParametersTests(
|
|
283
|
+
`/special-words/parameters/for`,
|
|
284
|
+
{
|
|
285
|
+
for: "ok",
|
|
286
|
+
},
|
|
287
|
+
"for",
|
|
288
|
+
);
|
|
289
|
+
Scenarios.SpecialWords_Parameters_from = createParametersTests(
|
|
290
|
+
`/special-words/parameters/from`,
|
|
291
|
+
{
|
|
292
|
+
from: "ok",
|
|
293
|
+
},
|
|
294
|
+
"from",
|
|
295
|
+
);
|
|
296
|
+
Scenarios.SpecialWords_Parameters_global = createParametersTests(
|
|
297
|
+
`/special-words/parameters/global`,
|
|
298
|
+
{
|
|
299
|
+
global: "ok",
|
|
300
|
+
},
|
|
301
|
+
"global",
|
|
302
|
+
);
|
|
303
|
+
Scenarios.SpecialWords_Parameters_if = createParametersTests(
|
|
304
|
+
`/special-words/parameters/if`,
|
|
305
|
+
{
|
|
306
|
+
if: "ok",
|
|
307
|
+
},
|
|
308
|
+
"if",
|
|
309
|
+
);
|
|
310
|
+
Scenarios.SpecialWords_Parameters_import = createParametersTests(
|
|
311
|
+
`/special-words/parameters/import`,
|
|
312
|
+
{
|
|
313
|
+
import: "ok",
|
|
314
|
+
},
|
|
315
|
+
"import",
|
|
316
|
+
);
|
|
317
|
+
Scenarios.SpecialWords_Parameters_in = createParametersTests(
|
|
318
|
+
`/special-words/parameters/in`,
|
|
319
|
+
{
|
|
320
|
+
in: "ok",
|
|
321
|
+
},
|
|
322
|
+
"in",
|
|
323
|
+
);
|
|
324
|
+
Scenarios.SpecialWords_Parameters_is = createParametersTests(
|
|
325
|
+
`/special-words/parameters/is`,
|
|
326
|
+
{
|
|
327
|
+
is: "ok",
|
|
328
|
+
},
|
|
329
|
+
"is",
|
|
330
|
+
);
|
|
331
|
+
Scenarios.SpecialWords_Parameters_lambda = createParametersTests(
|
|
332
|
+
`/special-words/parameters/lambda`,
|
|
333
|
+
{
|
|
334
|
+
lambda: "ok",
|
|
335
|
+
},
|
|
336
|
+
"lambda",
|
|
337
|
+
);
|
|
338
|
+
Scenarios.SpecialWords_Parameters_not = createParametersTests(
|
|
339
|
+
`/special-words/parameters/not`,
|
|
340
|
+
{
|
|
341
|
+
not: "ok",
|
|
342
|
+
},
|
|
343
|
+
"not",
|
|
344
|
+
);
|
|
345
|
+
Scenarios.SpecialWords_Parameters_or = createParametersTests(
|
|
346
|
+
`/special-words/parameters/or`,
|
|
347
|
+
{
|
|
348
|
+
or: "ok",
|
|
349
|
+
},
|
|
350
|
+
"or",
|
|
351
|
+
);
|
|
352
|
+
Scenarios.SpecialWords_Parameters_pass = createParametersTests(
|
|
353
|
+
`/special-words/parameters/pass`,
|
|
354
|
+
{
|
|
355
|
+
pass: "ok",
|
|
356
|
+
},
|
|
357
|
+
"pass",
|
|
358
|
+
);
|
|
359
|
+
Scenarios.SpecialWords_Parameters_raise = createParametersTests(
|
|
360
|
+
`/special-words/parameters/raise`,
|
|
361
|
+
{
|
|
362
|
+
raise: "ok",
|
|
363
|
+
},
|
|
364
|
+
"raise",
|
|
365
|
+
);
|
|
366
|
+
Scenarios.SpecialWords_Parameters_return = createParametersTests(
|
|
367
|
+
`/special-words/parameters/return`,
|
|
368
|
+
{
|
|
369
|
+
return: "ok",
|
|
370
|
+
},
|
|
371
|
+
"return",
|
|
372
|
+
);
|
|
373
|
+
Scenarios.SpecialWords_Parameters_try = createParametersTests(
|
|
374
|
+
`/special-words/parameters/try`,
|
|
375
|
+
{
|
|
376
|
+
try: "ok",
|
|
377
|
+
},
|
|
378
|
+
"try",
|
|
379
|
+
);
|
|
380
|
+
Scenarios.SpecialWords_Parameters_while = createParametersTests(
|
|
381
|
+
`/special-words/parameters/while`,
|
|
382
|
+
{
|
|
383
|
+
while: "ok",
|
|
384
|
+
},
|
|
385
|
+
"while",
|
|
386
|
+
);
|
|
387
|
+
Scenarios.SpecialWords_Parameters_with = createParametersTests(
|
|
388
|
+
`/special-words/parameters/with`,
|
|
389
|
+
{
|
|
390
|
+
with: "ok",
|
|
391
|
+
},
|
|
392
|
+
"with",
|
|
393
|
+
);
|
|
394
|
+
Scenarios.SpecialWords_Parameters_yield = createParametersTests(
|
|
395
|
+
`/special-words/parameters/yield`,
|
|
396
|
+
{
|
|
397
|
+
yield: "ok",
|
|
398
|
+
},
|
|
399
|
+
"yield",
|
|
400
|
+
);
|
|
401
|
+
Scenarios.SpecialWords_Parameters_cancellationToken = createParametersTests(
|
|
402
|
+
`/special-words/parameters/cancellationToken`,
|
|
403
|
+
{
|
|
404
|
+
cancellationToken: "ok",
|
|
405
|
+
},
|
|
406
|
+
"cancellationToken",
|
|
407
|
+
);
|