@azure-tools/typespec-ts 0.33.0 → 0.34.0
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 +37 -0
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/dependency.d.ts +25 -0
- package/dist/src/framework/dependency.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +16 -12
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts +4 -2
- package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +43 -8
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/refkey.js +1 -1
- package/dist/src/framework/refkey.js.map +1 -1
- package/dist/src/framework/sample.js +1 -1
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +81 -24
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +37 -3
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +26 -1
- package/dist/src/lib.js.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts +2 -2
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +25 -61
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +0 -7
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts +7 -3
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +58 -38
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildCodeModel.d.ts +18 -0
- package/dist/src/modular/buildCodeModel.d.ts.map +1 -1
- package/dist/src/modular/buildCodeModel.js +95 -42
- package/dist/src/modular/buildCodeModel.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts +3 -4
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +24 -45
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +3 -1
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +1 -1
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts +5 -0
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +62 -17
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +11 -10
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +13 -28
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +435 -240
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts +26 -0
- package/dist/src/modular/emitModelsOptions.d.ts.map +1 -0
- package/dist/src/modular/emitModelsOptions.js +106 -0
- package/dist/src/modular/emitModelsOptions.js.map +1 -0
- package/dist/src/modular/emitSamples.d.ts +7 -0
- package/dist/src/modular/emitSamples.d.ts.map +1 -0
- package/dist/src/modular/emitSamples.js +354 -0
- package/dist/src/modular/emitSamples.js.map +1 -0
- package/dist/src/modular/external-dependencies.d.ts +7 -0
- package/dist/src/modular/external-dependencies.d.ts.map +1 -1
- package/dist/src/modular/external-dependencies.js +58 -1
- package/dist/src/modular/external-dependencies.js.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +2 -2
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +13 -6
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +117 -48
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts +3 -2
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +3 -0
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +9 -11
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +255 -408
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +12 -0
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +30 -6
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/modularCodeModel.d.ts +2 -1
- package/dist/src/modular/modularCodeModel.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +5 -0
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -0
- package/dist/src/modular/serialization/buildDeserializerFunction.js +327 -0
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -0
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts +4 -3
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +285 -102
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts +15 -0
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -0
- package/dist/src/modular/serialization/serializeUtils.js +102 -0
- package/dist/src/modular/serialization/serializeUtils.js.map +1 -0
- package/dist/src/modular/type-expressions/get-credential-expression.d.ts +3 -0
- package/dist/src/modular/type-expressions/get-credential-expression.d.ts.map +1 -0
- package/dist/src/modular/type-expressions/get-credential-expression.js +17 -0
- package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -0
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +6 -0
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -0
- package/dist/src/modular/type-expressions/get-enum-expression.js +18 -0
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -0
- package/dist/src/modular/type-expressions/get-model-expression.d.ts +9 -0
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -0
- package/dist/src/modular/type-expressions/get-model-expression.js +42 -0
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -0
- package/dist/src/modular/type-expressions/get-type-expression.d.ts +8 -0
- package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -0
- package/dist/src/modular/type-expressions/get-type-expression.js +94 -0
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -0
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +5 -0
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -0
- package/dist/src/modular/type-expressions/get-union-expression.js +13 -0
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -0
- package/dist/src/modular/type-expressions/utils.d.ts +5 -0
- package/dist/src/modular/type-expressions/utils.d.ts.map +1 -0
- package/dist/src/modular/type-expressions/utils.js +9 -0
- package/dist/src/modular/type-expressions/utils.js.map +1 -0
- package/dist/src/transform/transform.js +1 -1
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.js +1 -1
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
- package/dist/src/transform/transformParameters.js +1 -1
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +3 -3
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/utils/clientUtils.d.ts.map +1 -1
- package/dist/src/utils/clientUtils.js +1 -4
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/credentialUtils.d.ts +5 -0
- package/dist/src/utils/credentialUtils.d.ts.map +1 -1
- package/dist/src/utils/credentialUtils.js +36 -4
- package/dist/src/utils/credentialUtils.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +28 -43
- package/dist/src/utils/modelUtils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +26 -26
- package/src/framework/declaration.ts +0 -1
- package/src/framework/dependency.ts +25 -0
- package/src/framework/hooks/binder.ts +19 -14
- package/src/framework/hooks/sdkTypes.ts +53 -13
- package/src/framework/refkey.ts +1 -1
- package/src/framework/sample.ts +1 -1
- package/src/index.ts +96 -25
- package/src/lib.ts +26 -3
- package/src/modular/buildClassicalClient.ts +30 -97
- package/src/modular/buildClassicalOperationGroups.ts +0 -14
- package/src/modular/buildClientContext.ts +90 -50
- package/src/modular/buildCodeModel.ts +118 -47
- package/src/modular/buildOperations.ts +41 -76
- package/src/modular/buildProjectFiles.ts +4 -2
- package/src/modular/buildRestorePoller.ts +1 -1
- package/src/modular/buildRootIndex.ts +75 -35
- package/src/modular/buildSubpathIndex.ts +13 -11
- package/src/modular/emitModels.ts +588 -326
- package/src/modular/emitModelsOptions.ts +161 -0
- package/src/modular/emitSamples.ts +481 -0
- package/src/modular/external-dependencies.ts +59 -1
- package/src/modular/helpers/classicalOperationHelpers.ts +6 -2
- package/src/modular/helpers/clientHelpers.ts +182 -76
- package/src/modular/helpers/namingHelpers.ts +14 -2
- package/src/modular/helpers/operationHelpers.ts +356 -638
- package/src/modular/helpers/typeHelpers.ts +38 -6
- package/src/modular/modularCodeModel.ts +3 -0
- package/src/modular/serialization/buildDeserializerFunction.ts +492 -0
- package/src/modular/serialization/buildSerializerFunction.ts +434 -141
- package/src/modular/serialization/serializeUtils.ts +143 -0
- package/src/modular/type-expressions/get-credential-expression.ts +18 -0
- package/src/modular/type-expressions/get-enum-expression.ts +28 -0
- package/src/modular/type-expressions/get-model-expression.ts +63 -0
- package/src/modular/type-expressions/get-type-expression.ts +111 -0
- package/src/modular/type-expressions/get-union-expression.ts +20 -0
- package/src/modular/type-expressions/utils.ts +15 -0
- package/src/transform/transform.ts +2 -2
- package/src/transform/transformApiVersionInfo.ts +2 -2
- package/src/transform/transformParameters.ts +1 -1
- package/src/transform/transformSchemas.ts +9 -8
- package/src/utils/clientUtils.ts +2 -12
- package/src/utils/credentialUtils.ts +43 -3
- package/src/utils/modelUtils.ts +32 -41
- package/static/static-helpers/serialization/serializers.ts +60 -0
- package/dist/src/modular/buildSerializeUtils.d.ts +0 -14
- package/dist/src/modular/buildSerializeUtils.d.ts.map +0 -1
- package/dist/src/modular/buildSerializeUtils.js +0 -534
- package/dist/src/modular/buildSerializeUtils.js.map +0 -1
- package/src/modular/buildSerializeUtils.ts +0 -749
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "An experimental TypeSpec emitter for TypeScript RLC",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
"author": "Jose Heredia <joheredi@microsoft.com>",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@azure-rest/core-client": "^2.1
|
|
21
|
-
"@azure-tools/cadl-ranch-expect": "^0.15.
|
|
22
|
-
"@azure-tools/cadl-ranch-specs": "^0.
|
|
23
|
-
"@azure-tools/cadl-ranch": "^0.
|
|
24
|
-
"@azure-tools/cadl-ranch-api": "^0.
|
|
25
|
-
"@azure-tools/typespec-autorest": ">=0.
|
|
26
|
-
"@azure-tools/typespec-azure-core": ">=0.
|
|
27
|
-
"@azure-tools/typespec-azure-resource-manager": ">=0.
|
|
28
|
-
"@azure-tools/typespec-client-generator-core": ">=0.
|
|
20
|
+
"@azure-rest/core-client": "^2.3.1",
|
|
21
|
+
"@azure-tools/cadl-ranch-expect": "^0.15.5",
|
|
22
|
+
"@azure-tools/cadl-ranch-specs": "^0.38.0",
|
|
23
|
+
"@azure-tools/cadl-ranch": "^0.15.0",
|
|
24
|
+
"@azure-tools/cadl-ranch-api": "^0.5.0",
|
|
25
|
+
"@azure-tools/typespec-autorest": ">=0.47.0 <1.0.0",
|
|
26
|
+
"@azure-tools/typespec-azure-core": ">=0.47.0 <1.0.0",
|
|
27
|
+
"@azure-tools/typespec-azure-resource-manager": ">=0.47.0 <1.0.0",
|
|
28
|
+
"@azure-tools/typespec-client-generator-core": ">=0.47.4 <1.0.0",
|
|
29
29
|
"@azure/abort-controller": "^2.1.2",
|
|
30
30
|
"@azure/core-auth": "^1.6.0",
|
|
31
|
-
"@azure/core-lro": "^3.
|
|
31
|
+
"@azure/core-lro": "^3.1.0",
|
|
32
32
|
"@azure/core-paging": "^1.5.0",
|
|
33
33
|
"@azure/core-rest-pipeline": "^1.14.0",
|
|
34
34
|
"@azure/core-util": "^1.4.0",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@types/node": "^18.0.0",
|
|
41
41
|
"@typescript-eslint/eslint-plugin": "^6.8.0",
|
|
42
42
|
"@typescript-eslint/parser": "^6.8.0",
|
|
43
|
-
"@typespec/compiler": ">=0.
|
|
44
|
-
"@typespec/http": ">=0.
|
|
45
|
-
"@typespec/openapi": ">=0.
|
|
46
|
-
"@typespec/rest": ">=0.
|
|
43
|
+
"@typespec/compiler": ">=0.61.2 <1.0.0",
|
|
44
|
+
"@typespec/http": ">=0.61.0 <1.0.0",
|
|
45
|
+
"@typespec/openapi": ">=0.61.0, <1.0.0",
|
|
46
|
+
"@typespec/rest": ">=0.61.0 <1.0.0",
|
|
47
47
|
"@typespec/ts-http-runtime": "1.0.0-alpha.20240314.2",
|
|
48
|
-
"@typespec/versioning": ">=0.
|
|
48
|
+
"@typespec/versioning": ">=0.61.0 <1.0.0",
|
|
49
49
|
"chai": "^4.3.6",
|
|
50
50
|
"chalk": "^4.0.0",
|
|
51
51
|
"cross-env": "^7.0.3",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"mkdirp": "^3.0.1",
|
|
55
55
|
"mocha": "^10.4.0",
|
|
56
56
|
"npm-run-all": "~4.1.5",
|
|
57
|
-
"prettier": "^3.
|
|
57
|
+
"prettier": "^3.3.3",
|
|
58
58
|
"rimraf": "^5.0.0",
|
|
59
59
|
"ts-node": "~10.9.1",
|
|
60
|
-
"typescript": "~5.
|
|
60
|
+
"typescript": "~5.6.2",
|
|
61
61
|
"vitest": "~1.6.0",
|
|
62
62
|
"@vitest/coverage-v8": "~1.6.0",
|
|
63
63
|
"@vitest/coverage-istanbul": "~1.6.0",
|
|
@@ -65,18 +65,18 @@
|
|
|
65
65
|
"tsx": "^4.16.5"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
|
-
"@azure-tools/typespec-azure-core": ">=0.
|
|
69
|
-
"@azure-tools/typespec-client-generator-core": ">=0.
|
|
70
|
-
"@typespec/compiler": ">=0.
|
|
71
|
-
"@typespec/http": ">=0.
|
|
72
|
-
"@typespec/rest": ">=0.
|
|
73
|
-
"@typespec/versioning": ">=0.
|
|
68
|
+
"@azure-tools/typespec-azure-core": ">=0.47.0 <1.0.0",
|
|
69
|
+
"@azure-tools/typespec-client-generator-core": ">=0.47.4 <1.0.0",
|
|
70
|
+
"@typespec/compiler": ">=0.61.2 <1.0.0",
|
|
71
|
+
"@typespec/http": ">=0.61.0 <1.0.0",
|
|
72
|
+
"@typespec/rest": ">=0.61.0 <1.0.0",
|
|
73
|
+
"@typespec/versioning": ">=0.61.0 <1.0.0"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@azure-tools/rlc-common": "^0.
|
|
76
|
+
"@azure-tools/rlc-common": "^0.34.0",
|
|
77
77
|
"fs-extra": "^11.1.0",
|
|
78
78
|
"lodash": "^4.17.21",
|
|
79
|
-
"prettier": "^3.
|
|
79
|
+
"prettier": "^3.3.3",
|
|
80
80
|
"ts-morph": "^23.0.0",
|
|
81
81
|
"tslib": "^2.3.1"
|
|
82
82
|
},
|
|
@@ -26,6 +26,11 @@ export interface CoreDependencies extends Record<string, ReferenceableSymbol> {
|
|
|
26
26
|
name: "OperationOptions";
|
|
27
27
|
module: string;
|
|
28
28
|
};
|
|
29
|
+
StreamableMethod: {
|
|
30
|
+
kind: "externalDependency";
|
|
31
|
+
name: "StreamableMethod";
|
|
32
|
+
module: string;
|
|
33
|
+
};
|
|
29
34
|
PathUncheckedResponse: {
|
|
30
35
|
kind: "externalDependency";
|
|
31
36
|
name: "PathUncheckedResponse";
|
|
@@ -56,6 +61,26 @@ export interface CoreDependencies extends Record<string, ReferenceableSymbol> {
|
|
|
56
61
|
name: "stringToUint8Array";
|
|
57
62
|
module: string;
|
|
58
63
|
};
|
|
64
|
+
isKeyCredential: {
|
|
65
|
+
kind: "externalDependency";
|
|
66
|
+
name: "isKeyCredential";
|
|
67
|
+
module: string;
|
|
68
|
+
};
|
|
69
|
+
KeyCredential: {
|
|
70
|
+
kind: "externalDependency";
|
|
71
|
+
name: "KeyCredential";
|
|
72
|
+
module: string;
|
|
73
|
+
};
|
|
74
|
+
TokenCredential: {
|
|
75
|
+
kind: "externalDependency";
|
|
76
|
+
name: "TokenCredential";
|
|
77
|
+
module: string;
|
|
78
|
+
};
|
|
79
|
+
ErrorModel: {
|
|
80
|
+
kind: "externalDependency";
|
|
81
|
+
name: "ErrorModel";
|
|
82
|
+
module: string;
|
|
83
|
+
};
|
|
59
84
|
}
|
|
60
85
|
|
|
61
86
|
export type CoreDependency = keyof CoreDependencies;
|
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
SourceFileSymbol,
|
|
15
15
|
StaticHelperMetadata
|
|
16
16
|
} from "../load-static-helpers.js";
|
|
17
|
+
import path from "path/posix";
|
|
18
|
+
import { normalizePath } from "@typespec/compiler";
|
|
17
19
|
|
|
18
20
|
export interface DeclarationInfo {
|
|
19
21
|
name: string;
|
|
@@ -40,10 +42,10 @@ export interface Binder {
|
|
|
40
42
|
sourceFile: SourceFile
|
|
41
43
|
): string;
|
|
42
44
|
resolveReference(refkey: unknown): string;
|
|
43
|
-
resolveAllReferences(): void;
|
|
45
|
+
resolveAllReferences(sourceRoot: string): void;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
const PLACEHOLDER_PREFIX = "
|
|
48
|
+
const PLACEHOLDER_PREFIX = "__PLACEHOLDER_";
|
|
47
49
|
|
|
48
50
|
class BinderImp implements Binder {
|
|
49
51
|
private declarations = new Map<unknown, DeclarationInfo>();
|
|
@@ -157,7 +159,7 @@ class BinderImp implements Binder {
|
|
|
157
159
|
* @returns The serialized placeholder string.
|
|
158
160
|
*/
|
|
159
161
|
private serializePlaceholder(refkey: unknown): string {
|
|
160
|
-
return `${PLACEHOLDER_PREFIX}${String(refkey)}
|
|
162
|
+
return `${PLACEHOLDER_PREFIX}${String(refkey)}__`;
|
|
161
163
|
}
|
|
162
164
|
|
|
163
165
|
/**
|
|
@@ -222,19 +224,19 @@ class BinderImp implements Binder {
|
|
|
222
224
|
/**
|
|
223
225
|
* Applies all tracked imports to their respective source files.
|
|
224
226
|
*/
|
|
225
|
-
resolveAllReferences(): void {
|
|
226
|
-
|
|
227
|
+
resolveAllReferences(sourceRoot: string): void {
|
|
228
|
+
this.project.getSourceFiles().map((file) => {
|
|
227
229
|
this.resolveDeclarationReferences(file);
|
|
228
230
|
this.resolveDependencyReferences(file);
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
231
|
+
const importStructures = this.imports.get(file);
|
|
232
|
+
if (importStructures) {
|
|
233
|
+
for (const importStructure of importStructures) {
|
|
234
|
+
file.addImportDeclaration(importStructure);
|
|
235
|
+
}
|
|
234
236
|
}
|
|
235
|
-
}
|
|
237
|
+
});
|
|
236
238
|
|
|
237
|
-
this.cleanUnreferencedHelpers();
|
|
239
|
+
this.cleanUnreferencedHelpers(sourceRoot);
|
|
238
240
|
}
|
|
239
241
|
|
|
240
242
|
private resolveDependencyReferences(file: SourceFile) {
|
|
@@ -296,7 +298,7 @@ class BinderImp implements Binder {
|
|
|
296
298
|
this.references.get(refkey)!.add(sourceFile);
|
|
297
299
|
}
|
|
298
300
|
|
|
299
|
-
private cleanUnreferencedHelpers() {
|
|
301
|
+
private cleanUnreferencedHelpers(sourceRoot: string) {
|
|
300
302
|
const usedHelperFiles = new Set<SourceFile>();
|
|
301
303
|
for (const helper of this.staticHelpers.values()) {
|
|
302
304
|
const sourceFile = helper[SourceFileSymbol];
|
|
@@ -314,7 +316,10 @@ class BinderImp implements Binder {
|
|
|
314
316
|
}
|
|
315
317
|
|
|
316
318
|
this.project
|
|
317
|
-
|
|
319
|
+
//normalizae the final path to adapt to different systems
|
|
320
|
+
.getSourceFiles(
|
|
321
|
+
normalizePath(path.join(sourceRoot, "static-helpers/**/*.ts"))
|
|
322
|
+
)
|
|
318
323
|
.filter((helperFile) => !usedHelperFiles.has(helperFile))
|
|
319
324
|
.forEach((helperFile) => helperFile.delete());
|
|
320
325
|
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
+
import { Operation, Type, getNamespaceFullName } from "@typespec/compiler";
|
|
1
2
|
import {
|
|
2
3
|
SdkClientType,
|
|
3
4
|
SdkHttpOperation,
|
|
4
|
-
SdkPackage,
|
|
5
5
|
SdkServiceMethod,
|
|
6
6
|
SdkType,
|
|
7
7
|
getClientType
|
|
8
8
|
} from "@azure-tools/typespec-client-generator-core";
|
|
9
|
-
import { Operation, Type, getNamespaceFullName } from "@typespec/compiler";
|
|
10
9
|
import { provideContext, useContext } from "../../contextManager.js";
|
|
11
10
|
|
|
11
|
+
import { visitPackageTypes } from "../../modular/emitModels.js";
|
|
12
|
+
import { SdkContext } from "../../utils/interfaces.js";
|
|
13
|
+
|
|
14
|
+
export const emitQueue: Set<SdkType> = new Set<SdkType>();
|
|
15
|
+
|
|
12
16
|
export interface SdkTypeContext {
|
|
13
17
|
operations: Map<Type, SdkServiceMethod<SdkHttpOperation>>;
|
|
14
18
|
types: Map<Type, SdkType>;
|
|
@@ -50,25 +54,56 @@ export function useSdkTypes() {
|
|
|
50
54
|
return getSdkType;
|
|
51
55
|
}
|
|
52
56
|
|
|
53
|
-
export function provideSdkTypes(
|
|
57
|
+
export function provideSdkTypes(context: SdkContext) {
|
|
58
|
+
const { sdkPackage } = context;
|
|
54
59
|
const sdkTypesContext = {
|
|
55
60
|
operations: new Map<Type, SdkServiceMethod<SdkHttpOperation>>(),
|
|
56
61
|
types: new Map<Type, SdkType>()
|
|
57
62
|
};
|
|
58
|
-
|
|
59
|
-
for (const
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
visitPackageTypes(context);
|
|
64
|
+
for (const sdkModel of emitQueue) {
|
|
65
|
+
switch (sdkModel.kind) {
|
|
66
|
+
case "model":
|
|
67
|
+
sdkModel.properties.forEach((prop) => {
|
|
68
|
+
sdkTypesContext.types.set(prop.type.__raw!, prop.type);
|
|
69
|
+
});
|
|
70
|
+
if (sdkModel.discriminatedSubtypes) {
|
|
71
|
+
Object.values(sdkModel.discriminatedSubtypes).forEach((subtype) => {
|
|
72
|
+
sdkTypesContext.types.set(subtype.__raw!, subtype);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
case "enum":
|
|
77
|
+
if (sdkModel.__raw) {
|
|
78
|
+
sdkTypesContext.types.set(sdkModel.__raw, sdkModel);
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
case "union":
|
|
82
|
+
sdkModel.variantTypes.forEach((v) => {
|
|
83
|
+
if (v.__raw) {
|
|
84
|
+
sdkTypesContext.types.set(v.__raw, v);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
break;
|
|
88
|
+
case "array":
|
|
89
|
+
sdkTypesContext.types.set(
|
|
90
|
+
sdkModel.valueType.__raw!,
|
|
91
|
+
sdkModel.valueType
|
|
92
|
+
);
|
|
93
|
+
break;
|
|
94
|
+
case "dict":
|
|
95
|
+
sdkTypesContext.types.set(
|
|
96
|
+
sdkModel.valueType.__raw!,
|
|
97
|
+
sdkModel.valueType
|
|
98
|
+
);
|
|
99
|
+
break;
|
|
100
|
+
case "nullable":
|
|
101
|
+
sdkTypesContext.types.set(sdkModel.type.__raw!, sdkModel.type);
|
|
102
|
+
break;
|
|
62
103
|
}
|
|
63
|
-
|
|
64
|
-
sdkTypesContext.types.set(sdkEnum.__raw, sdkEnum);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
for (const sdkModel of sdkPackage.models) {
|
|
68
104
|
if (!sdkModel.__raw) {
|
|
69
105
|
continue;
|
|
70
106
|
}
|
|
71
|
-
|
|
72
107
|
sdkTypesContext.types.set(sdkModel.__raw, sdkModel);
|
|
73
108
|
}
|
|
74
109
|
|
|
@@ -79,6 +114,11 @@ export function provideSdkTypes(sdkPackage: SdkPackage<SdkHttpOperation>) {
|
|
|
79
114
|
}
|
|
80
115
|
|
|
81
116
|
sdkTypesContext.operations.set(method.__raw, method);
|
|
117
|
+
|
|
118
|
+
// Visit the parameters of the method to add them to the types map
|
|
119
|
+
method.parameters.forEach((param) => {
|
|
120
|
+
sdkTypesContext.types.set(param.type.__raw!, param.type);
|
|
121
|
+
});
|
|
82
122
|
}
|
|
83
123
|
}
|
|
84
124
|
|
package/src/framework/refkey.ts
CHANGED
package/src/framework/sample.ts
CHANGED
|
@@ -67,7 +67,7 @@ sourceFile2.addStatements(`${functionReference}();`);
|
|
|
67
67
|
sourceFile2.addStatements(`let obj: ${modelReference} = { id: 1 };`);
|
|
68
68
|
|
|
69
69
|
// Apply imports to ensure correct references
|
|
70
|
-
binder.resolveAllReferences();
|
|
70
|
+
binder.resolveAllReferences("/modularPackageFolder/src");
|
|
71
71
|
|
|
72
72
|
// Output the generated files
|
|
73
73
|
console.log("// test.ts");
|
package/src/index.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
import * as fsextra from "fs-extra";
|
|
5
|
-
|
|
6
5
|
import {
|
|
7
6
|
AzureCoreDependencies,
|
|
7
|
+
AzureIdentityDependencies,
|
|
8
8
|
AzurePollingDependencies,
|
|
9
9
|
DefaultCoreDependencies
|
|
10
10
|
} from "./modular/external-dependencies.js";
|
|
@@ -44,9 +44,9 @@ import {
|
|
|
44
44
|
getClientName,
|
|
45
45
|
hasUnexpectedHelper,
|
|
46
46
|
isAzurePackage,
|
|
47
|
-
updatePackageFile
|
|
47
|
+
updatePackageFile,
|
|
48
|
+
buildSampleEnvFile
|
|
48
49
|
} from "@azure-tools/rlc-common";
|
|
49
|
-
import { buildModels, buildModelsOptions } from "./modular/emitModels.js";
|
|
50
50
|
import {
|
|
51
51
|
buildRootIndex,
|
|
52
52
|
buildSubClientIndexFile
|
|
@@ -56,19 +56,22 @@ import { provideContext, useContext } from "./contextManager.js";
|
|
|
56
56
|
|
|
57
57
|
import { EmitterOptions } from "./lib.js";
|
|
58
58
|
import { ModularCodeModel } from "./modular/modularCodeModel.js";
|
|
59
|
-
import { Project } from "ts-morph";
|
|
59
|
+
import { Project, SourceFile } from "ts-morph";
|
|
60
60
|
import { buildClassicOperationFiles } from "./modular/buildClassicalOperationGroups.js";
|
|
61
61
|
import { buildClassicalClient } from "./modular/buildClassicalClient.js";
|
|
62
|
-
import {
|
|
62
|
+
import {
|
|
63
|
+
getClientContextPath,
|
|
64
|
+
buildClientContext
|
|
65
|
+
} from "./modular/buildClientContext.js";
|
|
66
|
+
import { buildApiOptions } from "./modular/emitModelsOptions.js";
|
|
63
67
|
import { buildOperationFiles } from "./modular/buildOperations.js";
|
|
64
68
|
import { buildRestorePoller } from "./modular/buildRestorePoller.js";
|
|
65
|
-
import { buildSerializeUtils } from "./modular/buildSerializeUtils.js";
|
|
66
69
|
import { buildSubpathIndexFile } from "./modular/buildSubpathIndex.js";
|
|
67
70
|
import { createSdkContext } from "@azure-tools/typespec-client-generator-core";
|
|
68
71
|
import { emitCodeModel } from "./modular/buildCodeModel.js";
|
|
69
72
|
import { emitLoggerFile } from "./modular/emitLoggerFile.js";
|
|
70
73
|
import { emitSerializerHelpersFile } from "./modular/buildHelperSerializers.js";
|
|
71
|
-
import {
|
|
74
|
+
import { emitTypes } from "./modular/emitModels.js";
|
|
72
75
|
import { existsSync } from "fs";
|
|
73
76
|
import { getModuleExports } from "./modular/buildProjectFiles.js";
|
|
74
77
|
import { getRLCClients } from "./utils/clientUtils.js";
|
|
@@ -78,6 +81,7 @@ import { provideBinder } from "./framework/hooks/binder.js";
|
|
|
78
81
|
import { provideSdkTypes } from "./framework/hooks/sdkTypes.js";
|
|
79
82
|
import { transformRLCModel } from "./transform/transform.js";
|
|
80
83
|
import { transformRLCOptions } from "./transform/transfromRLCOptions.js";
|
|
84
|
+
import { emitSamples } from "./modular/emitSamples.js";
|
|
81
85
|
|
|
82
86
|
export * from "./lib.js";
|
|
83
87
|
|
|
@@ -105,7 +109,6 @@ export async function $onEmit(context: EmitContext) {
|
|
|
105
109
|
compilerContext: context,
|
|
106
110
|
tcgcContext: dpgContext
|
|
107
111
|
});
|
|
108
|
-
provideSdkTypes(dpgContext.sdkPackage);
|
|
109
112
|
const { modularSourcesDir } = await calculateGenerationDir(rlcOptions);
|
|
110
113
|
const staticHelpers = await loadStaticHelpers(
|
|
111
114
|
outputProject,
|
|
@@ -117,7 +120,11 @@ export async function $onEmit(context: EmitContext) {
|
|
|
117
120
|
{ sourcesDir: modularSourcesDir }
|
|
118
121
|
);
|
|
119
122
|
const extraDependencies = isAzurePackage({ options: rlcOptions })
|
|
120
|
-
? {
|
|
123
|
+
? {
|
|
124
|
+
...AzurePollingDependencies,
|
|
125
|
+
...AzureCoreDependencies,
|
|
126
|
+
...AzureIdentityDependencies
|
|
127
|
+
}
|
|
121
128
|
: { ...DefaultCoreDependencies };
|
|
122
129
|
const binder = provideBinder(outputProject, {
|
|
123
130
|
staticHelpers,
|
|
@@ -125,6 +132,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
125
132
|
...extraDependencies
|
|
126
133
|
}
|
|
127
134
|
});
|
|
135
|
+
provideSdkTypes(dpgContext);
|
|
128
136
|
|
|
129
137
|
const rlcCodeModels: RLCModel[] = [];
|
|
130
138
|
let modularCodeModel: ModularCodeModel;
|
|
@@ -259,27 +267,33 @@ export async function $onEmit(context: EmitContext) {
|
|
|
259
267
|
|
|
260
268
|
const isMultiClients = modularCodeModel.clients.length > 1;
|
|
261
269
|
|
|
270
|
+
emitTypes(dpgContext, { sourceRoot: modularSourcesRoot });
|
|
271
|
+
buildSubpathIndexFile(modularCodeModel, "models");
|
|
272
|
+
// Enable modular sample generation when explicitly set to true or MPG
|
|
273
|
+
if (emitterOptions?.generateSample === true) {
|
|
274
|
+
const samples = emitSamples(dpgContext);
|
|
275
|
+
// Refine the rlc sample generation logic
|
|
276
|
+
// TODO: remember to remove this out when RLC is splitted from Modular
|
|
277
|
+
if (samples.length > 0) {
|
|
278
|
+
dpgContext.rlcOptions!.generateSample = true;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
262
281
|
for (const subClient of modularCodeModel.clients) {
|
|
263
|
-
|
|
264
|
-
buildModelsOptions(subClient, modularCodeModel);
|
|
265
|
-
if (!env["EXPERIMENTAL_TYPESPEC_TS_SERIALIZATION"])
|
|
266
|
-
buildSerializeUtils(modularCodeModel);
|
|
267
|
-
// build operation files
|
|
282
|
+
buildApiOptions(dpgContext, subClient, modularCodeModel);
|
|
268
283
|
buildOperationFiles(subClient, dpgContext, modularCodeModel);
|
|
269
284
|
buildClientContext(subClient, dpgContext, modularCodeModel);
|
|
270
|
-
buildSubpathIndexFile(subClient, modularCodeModel, "models");
|
|
271
285
|
buildRestorePoller(modularCodeModel, subClient);
|
|
272
286
|
if (dpgContext.rlcOptions?.hierarchyClient) {
|
|
273
|
-
buildSubpathIndexFile(
|
|
287
|
+
buildSubpathIndexFile(modularCodeModel, "api", subClient);
|
|
274
288
|
} else {
|
|
275
|
-
buildSubpathIndexFile(
|
|
289
|
+
buildSubpathIndexFile(modularCodeModel, "api", subClient, {
|
|
276
290
|
exportIndex: true
|
|
277
291
|
});
|
|
278
292
|
}
|
|
279
293
|
|
|
280
294
|
buildClassicalClient(subClient, dpgContext, modularCodeModel);
|
|
281
295
|
buildClassicOperationFiles(dpgContext, modularCodeModel, subClient);
|
|
282
|
-
buildSubpathIndexFile(
|
|
296
|
+
buildSubpathIndexFile(modularCodeModel, "classic", subClient, {
|
|
283
297
|
exportIndex: true,
|
|
284
298
|
interfaceOnly: true
|
|
285
299
|
});
|
|
@@ -289,10 +303,19 @@ export async function $onEmit(context: EmitContext) {
|
|
|
289
303
|
buildRootIndex(subClient, modularCodeModel, rootIndexFile);
|
|
290
304
|
}
|
|
291
305
|
|
|
292
|
-
binder.resolveAllReferences();
|
|
306
|
+
binder.resolveAllReferences(modularSourcesRoot);
|
|
293
307
|
|
|
294
308
|
for (const file of project.getSourceFiles()) {
|
|
295
|
-
file.fixMissingImports(
|
|
309
|
+
file.fixMissingImports(
|
|
310
|
+
{},
|
|
311
|
+
{
|
|
312
|
+
importModuleSpecifierEnding: "js",
|
|
313
|
+
importModuleSpecifierPreference: "relative",
|
|
314
|
+
includePackageJsonAutoImports: "off",
|
|
315
|
+
excludeLibrarySymbolsInNavTo: true
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
await removeUnusedImports(file);
|
|
296
319
|
file.fixUnusedIdentifiers();
|
|
297
320
|
await emitContentByBuilder(
|
|
298
321
|
program,
|
|
@@ -303,6 +326,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
303
326
|
}
|
|
304
327
|
|
|
305
328
|
async function generateMetadataAndTest() {
|
|
329
|
+
const project = useContext("outputProject");
|
|
306
330
|
if (rlcCodeModels.length === 0 || !rlcCodeModels[0]) {
|
|
307
331
|
return;
|
|
308
332
|
}
|
|
@@ -323,7 +347,8 @@ export async function $onEmit(context: EmitContext) {
|
|
|
323
347
|
buildRollupConfig,
|
|
324
348
|
buildApiExtractorConfig,
|
|
325
349
|
buildReadmeFile,
|
|
326
|
-
buildLicenseFile
|
|
350
|
+
buildLicenseFile,
|
|
351
|
+
buildSampleEnvFile
|
|
327
352
|
];
|
|
328
353
|
if (option.moduleKind === "esm") {
|
|
329
354
|
commonBuilders.push((model) => buildVitestConfig(model, "node"));
|
|
@@ -343,7 +368,8 @@ export async function $onEmit(context: EmitContext) {
|
|
|
343
368
|
...modularPackageInfo,
|
|
344
369
|
dependencies: {
|
|
345
370
|
"@azure/core-util": "^1.9.2"
|
|
346
|
-
}
|
|
371
|
+
},
|
|
372
|
+
clientContextPaths: getRelativeContextPaths(modularCodeModel)
|
|
347
373
|
};
|
|
348
374
|
}
|
|
349
375
|
}
|
|
@@ -360,7 +386,6 @@ export async function $onEmit(context: EmitContext) {
|
|
|
360
386
|
);
|
|
361
387
|
|
|
362
388
|
if (option.isModularLibrary) {
|
|
363
|
-
const project = useContext("outputProject");
|
|
364
389
|
for (const file of project.getSourceFiles()) {
|
|
365
390
|
await emitContentByBuilder(
|
|
366
391
|
program,
|
|
@@ -389,15 +414,52 @@ export async function $onEmit(context: EmitContext) {
|
|
|
389
414
|
);
|
|
390
415
|
}
|
|
391
416
|
}
|
|
417
|
+
|
|
418
|
+
function getRelativeContextPaths(codeModel: ModularCodeModel) {
|
|
419
|
+
return codeModel.clients
|
|
420
|
+
.map((subClient) => getClientContextPath(subClient, codeModel))
|
|
421
|
+
.map((path) => path.substring(path.indexOf("src")));
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export async function removeUnusedImports(file: SourceFile) {
|
|
426
|
+
file.getImportDeclarations().map((importDeclaration) => {
|
|
427
|
+
importDeclaration.getFullText();
|
|
428
|
+
importDeclaration.getNamedImports().map((namedImport) => {
|
|
429
|
+
namedImport.getFullText();
|
|
430
|
+
if (
|
|
431
|
+
namedImport
|
|
432
|
+
.getNameNode()
|
|
433
|
+
.findReferencesAsNodes()
|
|
434
|
+
.filter((n) => {
|
|
435
|
+
return n.getSourceFile().getFilePath() === file.getFilePath();
|
|
436
|
+
}).length === 1
|
|
437
|
+
) {
|
|
438
|
+
namedImport.remove();
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
if (importDeclaration.getNamedImports().length === 0) {
|
|
442
|
+
importDeclaration.remove();
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
file.getExportDeclarations().map((exportDeclaration) => {
|
|
446
|
+
if (exportDeclaration.getNamedExports().length === 0) {
|
|
447
|
+
exportDeclaration.remove();
|
|
448
|
+
}
|
|
449
|
+
});
|
|
392
450
|
}
|
|
393
451
|
|
|
394
452
|
export async function createContextWithDefaultOptions(
|
|
395
453
|
context: EmitContext<Record<string, any>>
|
|
396
454
|
): Promise<SdkContext> {
|
|
455
|
+
const flattenUnionAsEnum =
|
|
456
|
+
context.options["experimentalExtensibleEnums"] === undefined
|
|
457
|
+
? isArm(context)
|
|
458
|
+
: context.options["experimentalExtensibleEnums"];
|
|
397
459
|
const tcgcSettings = {
|
|
398
460
|
"generate-protocol-methods": true,
|
|
399
461
|
"generate-convenience-methods": true,
|
|
400
|
-
"flatten-union-as-enum":
|
|
462
|
+
"flatten-union-as-enum": flattenUnionAsEnum,
|
|
401
463
|
emitters: [
|
|
402
464
|
{
|
|
403
465
|
main: "@azure-tools/typespec-ts",
|
|
@@ -410,5 +472,14 @@ export async function createContextWithDefaultOptions(
|
|
|
410
472
|
...tcgcSettings
|
|
411
473
|
};
|
|
412
474
|
|
|
413
|
-
return (await createSdkContext(
|
|
475
|
+
return (await createSdkContext(
|
|
476
|
+
context,
|
|
477
|
+
context.program.emitters[0]?.metadata.name ?? "@azure-tools/typespec-ts"
|
|
478
|
+
)) as SdkContext;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// TODO: should be removed once tcgc issue is resolved https://github.com/Azure/typespec-azure/issues/1794
|
|
482
|
+
function isArm(context: EmitContext<Record<string, any>>) {
|
|
483
|
+
const packageName = (context?.options["packageDetails"] ?? {})["name"] ?? "";
|
|
484
|
+
return packageName?.startsWith("@azure/arm-");
|
|
414
485
|
}
|
package/src/lib.ts
CHANGED
|
@@ -11,8 +11,6 @@ import { Options } from "prettier";
|
|
|
11
11
|
|
|
12
12
|
export interface EmitterOptions extends RLCOptions {
|
|
13
13
|
branded?: boolean;
|
|
14
|
-
compatibilityMode?: boolean;
|
|
15
|
-
experimentalExtensibleEnums?: boolean;
|
|
16
14
|
}
|
|
17
15
|
|
|
18
16
|
export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
|
|
@@ -93,7 +91,8 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
|
|
|
93
91
|
},
|
|
94
92
|
compatibilityMode: { type: "boolean", nullable: true },
|
|
95
93
|
experimentalExtensibleEnums: { type: "boolean", nullable: true },
|
|
96
|
-
clearOutputFolder: { type: "boolean", nullable: true }
|
|
94
|
+
clearOutputFolder: { type: "boolean", nullable: true },
|
|
95
|
+
ignorePropertyNameNormalize: { type: "boolean", nullable: true }
|
|
97
96
|
},
|
|
98
97
|
required: []
|
|
99
98
|
};
|
|
@@ -244,6 +243,30 @@ const libDef = {
|
|
|
244
243
|
messages: {
|
|
245
244
|
default: paramMessage`Authentication type ${"credentialType"} is not supported.`
|
|
246
245
|
}
|
|
246
|
+
},
|
|
247
|
+
"un-supported-finalStateVia": {
|
|
248
|
+
severity: "warning",
|
|
249
|
+
messages: {
|
|
250
|
+
default: paramMessage`The LRO final-state-via ${"finalStateVia"} is not supported.`
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"required-sample-parameter": {
|
|
254
|
+
severity: "warning",
|
|
255
|
+
messages: {
|
|
256
|
+
default: paramMessage`The parameter ${"paramName"} in ${"exampleName"} is required but no value provided.`
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"property-name-normalized": {
|
|
260
|
+
severity: "warning",
|
|
261
|
+
messages: {
|
|
262
|
+
default: paramMessage`Property name ${"propertyName"} is normalized to ${"normalizedName"}.`
|
|
263
|
+
}
|
|
264
|
+
},
|
|
265
|
+
"optional-path-param": {
|
|
266
|
+
severity: "error",
|
|
267
|
+
messages: {
|
|
268
|
+
default: paramMessage`Path parameter '${"paramName"}' cannot be optional.`
|
|
269
|
+
}
|
|
247
270
|
}
|
|
248
271
|
},
|
|
249
272
|
emitter: {
|