From 6b300c901f6b060a8be79b7a2988d03040f02930 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 12 Sep 2024 16:54:11 +0800 Subject: [PATCH 1/9] bump --- core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core b/core index 99abec93e9..deae32ea6f 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 99abec93e9551e61a4393f6fd55e99db54efd3e9 +Subproject commit deae32ea6fa699327310ec7608d65dfba375c0c3 From 41de2d8792d436da532738f514603beaedc33b77 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 12 Sep 2024 16:59:06 +0800 Subject: [PATCH 2/9] bump npm packages --- typespec-extension/changelog.md | 4 + typespec-extension/package-lock.json | 366 +++++++++++++-------------- typespec-extension/package.json | 54 ++-- typespec-extension/readme.md | 4 +- typespec-tests/package.json | 24 +- 5 files changed, 228 insertions(+), 224 deletions(-) diff --git a/typespec-extension/changelog.md b/typespec-extension/changelog.md index dc924458da..e4e317ad4e 100644 --- a/typespec-extension/changelog.md +++ b/typespec-extension/changelog.md @@ -1,5 +1,9 @@ # Release History +## 0.20.2 (2024-09-13) + +Compatible with compiler 0.60. + ## 0.20.2 (2024-09-10) Compatible with compiler 0.59. diff --git a/typespec-extension/package-lock.json b/typespec-extension/package-lock.json index e4aad0f906..3a8ae482c2 100644 --- a/typespec-extension/package-lock.json +++ b/typespec-extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "@azure-tools/typespec-java", - "version": "0.20.2", + "version": "0.20.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@azure-tools/typespec-java", - "version": "0.20.2", + "version": "0.20.3", "license": "MIT", "dependencies": { "@autorest/codemodel": "~4.20.0", @@ -14,46 +14,46 @@ "lodash": "~4.17.21" }, "devDependencies": { - "@azure-tools/typespec-autorest": "0.45.0", - "@azure-tools/typespec-azure-core": "0.45.0", - "@azure-tools/typespec-azure-resource-manager": "0.45.0", - "@azure-tools/typespec-azure-rulesets": "0.45.0", - "@azure-tools/typespec-client-generator-core": "0.45.4", + "@azure-tools/typespec-autorest": "0.46.0", + "@azure-tools/typespec-azure-core": "0.46.0", + "@azure-tools/typespec-azure-resource-manager": "0.46.0", + "@azure-tools/typespec-azure-rulesets": "0.46.0", + "@azure-tools/typespec-client-generator-core": "0.46.0", "@types/js-yaml": "~4.0.9", "@types/lodash": "~4.17.7", "@types/mocha": "~10.0.7", - "@types/node": "~22.5.1", - "@typescript-eslint/eslint-plugin": "~8.3.0", - "@typescript-eslint/parser": "~8.3.0", - "@typespec/compiler": "0.59.1", - "@typespec/http": "0.59.1", - "@typespec/openapi": "0.59.0", - "@typespec/rest": "0.59.1", - "@typespec/versioning": "0.59.0", - "@typespec/xml": "0.59.0", + "@types/node": "~22.5.4", + "@typescript-eslint/eslint-plugin": "~8.5.0", + "@typescript-eslint/parser": "~8.5.0", + "@typespec/compiler": "0.60.0", + "@typespec/http": "0.60.0", + "@typespec/openapi": "0.60.0", + "@typespec/rest": "0.60.0", + "@typespec/versioning": "0.60.1", + "@typespec/xml": "0.60.0", "c8": "~10.1.2", "eslint": "~8.57.0", "eslint-plugin-deprecation": "~3.0.0", "mocha": "~10.7.3", "prettier": "~3.3.3", "rimraf": "~6.0.1", - "typescript": "~5.5.4" + "typescript": "~5.6.2" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "@azure-tools/typespec-autorest": ">=0.45.0 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.45.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.45.0 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.45.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.45.4 <1.0.0", - "@typespec/compiler": ">=0.59.0 <1.0.0", - "@typespec/http": ">=0.59.0 <1.0.0", - "@typespec/openapi": ">=0.59.0 <1.0.0", - "@typespec/rest": ">=0.59.0 <1.0.0", - "@typespec/versioning": ">=0.59.0 <1.0.0", - "@typespec/xml": ">=0.59.0 <1.0.0" + "@azure-tools/typespec-autorest": ">=0.46.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.46.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.46.0 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">=0.46.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.46.0 <1.0.0", + "@typespec/compiler": ">=0.60.0 <1.0.0", + "@typespec/http": ">=0.60.0 <1.0.0", + "@typespec/openapi": ">=0.60.0 <1.0.0", + "@typespec/rest": ">=0.60.0 <1.0.0", + "@typespec/versioning": ">=0.60.0 <1.0.0", + "@typespec/xml": ">=0.60.0 <1.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -106,42 +106,42 @@ } }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.45.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.45.0.tgz", - "integrity": "sha512-6ycZ0bEfXC0U26FHHEt9smAhxh78SACIDY+u7zLAopRzmxjTuthDdGgYSShuRDu3J+vEBi1fOKpz4cYQkgRkBQ==", + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.46.0.tgz", + "integrity": "sha512-LCIvxQgjczWUq/wi6fzKBqYHWJYD0hRLA8wBPzFasriHdBDHjpZ6vgTPmApzt0H5ArZX92Ar53Q5+ZXD9ktMUg==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.45.0", - "@azure-tools/typespec-azure-resource-manager": "~0.45.0", - "@azure-tools/typespec-client-generator-core": "~0.45.0", - "@typespec/compiler": "~0.59.0", - "@typespec/http": "~0.59.0", - "@typespec/openapi": "~0.59.0", - "@typespec/rest": "~0.59.0", - "@typespec/versioning": "~0.59.0" + "@azure-tools/typespec-azure-core": "~0.46.0", + "@azure-tools/typespec-azure-resource-manager": "~0.46.0", + "@azure-tools/typespec-client-generator-core": "~0.46.0", + "@typespec/compiler": "~0.60.0", + "@typespec/http": "~0.60.0", + "@typespec/openapi": "~0.60.0", + "@typespec/rest": "~0.60.0", + "@typespec/versioning": "~0.60.0" } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.45.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.45.0.tgz", - "integrity": "sha512-GycGMCmaIVSN+TftPtlPJLyeOrglbLmH08ZiZaVMjSih/TQEJM21RGR6d8QdjlkQWN61ntNDRD+RP2uv9tHmqw==", + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.46.0.tgz", + "integrity": "sha512-BNE31enSHWtWlrdIKShBS6CNFGk3OYmHSBnWqobcFJkTGXC090EoV2u6otn4BMI99fZRSR4gpwp/kYU9KLE9Jw==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.59.0", - "@typespec/http": "~0.59.0", - "@typespec/rest": "~0.59.0" + "@typespec/compiler": "~0.60.0", + "@typespec/http": "~0.60.0", + "@typespec/rest": "~0.60.0" } }, "node_modules/@azure-tools/typespec-azure-resource-manager": { - "version": "0.45.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.45.0.tgz", - "integrity": "sha512-PdhB03P8PoOlUoUWd+CF5WipGzu2Q3ZjT0EAzgQe878DmXvxMq+zYaPJQtvkq9R6jCxFauDSr5gG7Yd4NINAuA==", + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.46.0.tgz", + "integrity": "sha512-ileS/0OMp0pmtWU3k0g2ZGfA957nOiEHtFJzAILsYYBFeBWgWuEuCPcKaGYScvlYTTK4Pyplpb7u00RBZBBObQ==", "dev": true, "dependencies": { "change-case": "~5.4.4", @@ -151,33 +151,33 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.45.0", - "@typespec/compiler": "~0.59.0", - "@typespec/http": "~0.59.0", - "@typespec/openapi": "~0.59.0", - "@typespec/rest": "~0.59.0", - "@typespec/versioning": "~0.59.0" + "@azure-tools/typespec-azure-core": "~0.46.0", + "@typespec/compiler": "~0.60.0", + "@typespec/http": "~0.60.0", + "@typespec/openapi": "~0.60.0", + "@typespec/rest": "~0.60.0", + "@typespec/versioning": "~0.60.0" } }, "node_modules/@azure-tools/typespec-azure-rulesets": { - "version": "0.45.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.45.0.tgz", - "integrity": "sha512-OpMYYc0ElxnswABud22GSqE24ZoJCRGh9fwSA8SoqsJr0uXRX7D6D5pA1FHFT3b5uBVHy0l+FFHvjz9wxfsbUw==", + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.46.0.tgz", + "integrity": "sha512-HssO+0ARHbnuLhRiT/7l5DF2hV91Jf/MmsSPdOsDMbVZG26YsB8JD1MiBqs9VJZjB+1xn2DiimYrgqF4n9aDvw==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.45.0", - "@azure-tools/typespec-azure-resource-manager": "~0.45.0", - "@azure-tools/typespec-client-generator-core": "~0.45.0", - "@typespec/compiler": "~0.59.0" + "@azure-tools/typespec-azure-core": "~0.46.0", + "@azure-tools/typespec-azure-resource-manager": "~0.46.0", + "@azure-tools/typespec-client-generator-core": "~0.46.0", + "@typespec/compiler": "~0.60.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.45.4", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.45.4.tgz", - "integrity": "sha512-QJygwMqhEtBi2tPYs/HAfs0QTowXAwp6QpP/Vd2pHnJAncTV1BN17n/9LLAlMu2CnLimqvTuIN+FfliM28AX9w==", + "version": "0.46.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.46.0.tgz", + "integrity": "sha512-Ss0dNcOeTyc9CBsNFV6OToLV7OOKidAfeewmKePtY2qAHW+CqWZnVvUHunpFt2jFs6CqjFpgU9g+1wPbLCFj9A==", "dev": true, "dependencies": { "change-case": "~5.4.4", @@ -187,12 +187,12 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.45.0", - "@typespec/compiler": "~0.59.0", - "@typespec/http": "~0.59.0", - "@typespec/openapi": "~0.59.0", - "@typespec/rest": "~0.59.0", - "@typespec/versioning": "~0.59.0" + "@azure-tools/typespec-azure-core": "~0.46.0", + "@typespec/compiler": "~0.60.0", + "@typespec/http": "~0.60.0", + "@typespec/openapi": "~0.60.0", + "@typespec/rest": "~0.60.0", + "@typespec/versioning": "~0.60.0" } }, "node_modules/@babel/code-frame": { @@ -528,25 +528,25 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.5.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.1.tgz", - "integrity": "sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw==", + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", "dev": true, "dependencies": { "undici-types": "~6.19.2" } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.3.0.tgz", - "integrity": "sha512-FLAIn63G5KH+adZosDYiutqkOkYEx0nvcwNNfJAf+c7Ae/H35qWwTYvPZUKFj5AS+WfHG/WJJfWnDnyNUlp8UA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.5.0.tgz", + "integrity": "sha512-lHS5hvz33iUFQKuPFGheAB84LwcJ60G8vKnEhnfcK1l8kGVLro2SFYW6K0/tj8FUhRJ0VHyg1oAfg50QGbPPHw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.3.0", - "@typescript-eslint/type-utils": "8.3.0", - "@typescript-eslint/utils": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0", + "@typescript-eslint/scope-manager": "8.5.0", + "@typescript-eslint/type-utils": "8.5.0", + "@typescript-eslint/utils": "8.5.0", + "@typescript-eslint/visitor-keys": "8.5.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -570,13 +570,13 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.3.0.tgz", - "integrity": "sha512-mz2X8WcN2nVu5Hodku+IR8GgCOl4C0G/Z1ruaWN4dgec64kDBabuXyPAr+/RgJtumv8EEkqIzf3X2U5DUKB2eg==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.5.0.tgz", + "integrity": "sha512-06JOQ9Qgj33yvBEx6tpC8ecP9o860rsR22hWMEd12WcTRrfaFgHr2RB/CA/B+7BMhHkXT4chg2MyboGdFGawYg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0" + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/visitor-keys": "8.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -587,9 +587,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.3.0.tgz", - "integrity": "sha512-y6sSEeK+facMaAyixM36dQ5NVXTnKWunfD1Ft4xraYqxP0lC0POJmIaL/mw72CUMqjY9qfyVfXafMeaUj0noWw==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.5.0.tgz", + "integrity": "sha512-qjkormnQS5wF9pjSi6q60bKUHH44j2APxfh9TQRXK8wbYVeDYYdYJGIROL87LGZZ2gz3Rbmjc736qyL8deVtdw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -600,13 +600,13 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.3.0.tgz", - "integrity": "sha512-Mq7FTHl0R36EmWlCJWojIC1qn/ZWo2YiWYc1XVtasJ7FIgjo0MVv9rZWXEE7IK2CGrtwe1dVOxWwqXUdNgfRCA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.5.0.tgz", + "integrity": "sha512-vEG2Sf9P8BPQ+d0pxdfndw3xIXaoSjliG0/Ejk7UggByZPKXmJmw3GW5jV2gHNQNawBUyfahoSiCFVov0Ruf7Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0", + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/visitor-keys": "8.5.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -628,15 +628,15 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.3.0.tgz", - "integrity": "sha512-F77WwqxIi/qGkIGOGXNBLV7nykwfjLsdauRB/DOFPdv6LTF3BHHkBpq81/b5iMPSF055oO2BiivDJV4ChvNtXA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.5.0.tgz", + "integrity": "sha512-6yyGYVL0e+VzGYp60wvkBHiqDWOpT63pdMV2CVG4LVDd5uR6q1qQN/7LafBZtAtNIn/mqXjsSeS5ggv/P0iECw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.3.0", - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/typescript-estree": "8.3.0" + "@typescript-eslint/scope-manager": "8.5.0", + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/typescript-estree": "8.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -650,12 +650,12 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.3.0.tgz", - "integrity": "sha512-RmZwrTbQ9QveF15m/Cl28n0LXD6ea2CjkhH5rQ55ewz3H24w+AMCJHPVYaZ8/0HoG8Z3cLLFFycRXxeO2tz9FA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.5.0.tgz", + "integrity": "sha512-yTPqMnbAZJNy2Xq2XU8AdtOW9tJIr+UQb64aXB9f3B1498Zx9JorVgFJcZpEc9UBuCCrdzKID2RGAMkYcDtZOw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", + "@typescript-eslint/types": "8.5.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -691,15 +691,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.3.0.tgz", - "integrity": "sha512-h53RhVyLu6AtpUzVCYLPhZGL5jzTD9fZL+SYf/+hYOx2bDkyQXztXSc4tbvKYHzfMXExMLiL9CWqJmVz6+78IQ==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.5.0.tgz", + "integrity": "sha512-gF77eNv0Xz2UJg/NbpWJ0kqAm35UMsvZf1GHj8D9MRFTj/V3tAciIWXfmPLsAAF/vUlpWPvUDyH1jjsr0cMVWw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.3.0", - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/typescript-estree": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0", + "@typescript-eslint/scope-manager": "8.5.0", + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/typescript-estree": "8.5.0", + "@typescript-eslint/visitor-keys": "8.5.0", "debug": "^4.3.4" }, "engines": { @@ -719,13 +719,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.3.0.tgz", - "integrity": "sha512-mz2X8WcN2nVu5Hodku+IR8GgCOl4C0G/Z1ruaWN4dgec64kDBabuXyPAr+/RgJtumv8EEkqIzf3X2U5DUKB2eg==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.5.0.tgz", + "integrity": "sha512-06JOQ9Qgj33yvBEx6tpC8ecP9o860rsR22hWMEd12WcTRrfaFgHr2RB/CA/B+7BMhHkXT4chg2MyboGdFGawYg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0" + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/visitor-keys": "8.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -736,9 +736,9 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.3.0.tgz", - "integrity": "sha512-y6sSEeK+facMaAyixM36dQ5NVXTnKWunfD1Ft4xraYqxP0lC0POJmIaL/mw72CUMqjY9qfyVfXafMeaUj0noWw==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.5.0.tgz", + "integrity": "sha512-qjkormnQS5wF9pjSi6q60bKUHH44j2APxfh9TQRXK8wbYVeDYYdYJGIROL87LGZZ2gz3Rbmjc736qyL8deVtdw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -749,13 +749,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.3.0.tgz", - "integrity": "sha512-Mq7FTHl0R36EmWlCJWojIC1qn/ZWo2YiWYc1XVtasJ7FIgjo0MVv9rZWXEE7IK2CGrtwe1dVOxWwqXUdNgfRCA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.5.0.tgz", + "integrity": "sha512-vEG2Sf9P8BPQ+d0pxdfndw3xIXaoSjliG0/Ejk7UggByZPKXmJmw3GW5jV2gHNQNawBUyfahoSiCFVov0Ruf7Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0", + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/visitor-keys": "8.5.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -777,12 +777,12 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.3.0.tgz", - "integrity": "sha512-RmZwrTbQ9QveF15m/Cl28n0LXD6ea2CjkhH5rQ55ewz3H24w+AMCJHPVYaZ8/0HoG8Z3cLLFFycRXxeO2tz9FA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.5.0.tgz", + "integrity": "sha512-yTPqMnbAZJNy2Xq2XU8AdtOW9tJIr+UQb64aXB9f3B1498Zx9JorVgFJcZpEc9UBuCCrdzKID2RGAMkYcDtZOw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", + "@typescript-eslint/types": "8.5.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -834,13 +834,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.3.0.tgz", - "integrity": "sha512-wrV6qh//nLbfXZQoj32EXKmwHf4b7L+xXLrP3FZ0GOUU72gSvLjeWUl5J5Ue5IwRxIV1TfF73j/eaBapxx99Lg==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.5.0.tgz", + "integrity": "sha512-N1K8Ix+lUM+cIDhL2uekVn/ZD7TZW+9/rwz8DclQpcQ9rk4sIL5CAlBC0CugWKREmDjBzI/kQqU4wkg46jWLYA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "8.3.0", - "@typescript-eslint/utils": "8.3.0", + "@typescript-eslint/typescript-estree": "8.5.0", + "@typescript-eslint/utils": "8.5.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -858,13 +858,13 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.3.0.tgz", - "integrity": "sha512-mz2X8WcN2nVu5Hodku+IR8GgCOl4C0G/Z1ruaWN4dgec64kDBabuXyPAr+/RgJtumv8EEkqIzf3X2U5DUKB2eg==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.5.0.tgz", + "integrity": "sha512-06JOQ9Qgj33yvBEx6tpC8ecP9o860rsR22hWMEd12WcTRrfaFgHr2RB/CA/B+7BMhHkXT4chg2MyboGdFGawYg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0" + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/visitor-keys": "8.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -875,9 +875,9 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.3.0.tgz", - "integrity": "sha512-y6sSEeK+facMaAyixM36dQ5NVXTnKWunfD1Ft4xraYqxP0lC0POJmIaL/mw72CUMqjY9qfyVfXafMeaUj0noWw==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.5.0.tgz", + "integrity": "sha512-qjkormnQS5wF9pjSi6q60bKUHH44j2APxfh9TQRXK8wbYVeDYYdYJGIROL87LGZZ2gz3Rbmjc736qyL8deVtdw==", "dev": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -888,13 +888,13 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.3.0.tgz", - "integrity": "sha512-Mq7FTHl0R36EmWlCJWojIC1qn/ZWo2YiWYc1XVtasJ7FIgjo0MVv9rZWXEE7IK2CGrtwe1dVOxWwqXUdNgfRCA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.5.0.tgz", + "integrity": "sha512-vEG2Sf9P8BPQ+d0pxdfndw3xIXaoSjliG0/Ejk7UggByZPKXmJmw3GW5jV2gHNQNawBUyfahoSiCFVov0Ruf7Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/visitor-keys": "8.3.0", + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/visitor-keys": "8.5.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -916,15 +916,15 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.3.0.tgz", - "integrity": "sha512-F77WwqxIi/qGkIGOGXNBLV7nykwfjLsdauRB/DOFPdv6LTF3BHHkBpq81/b5iMPSF055oO2BiivDJV4ChvNtXA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.5.0.tgz", + "integrity": "sha512-6yyGYVL0e+VzGYp60wvkBHiqDWOpT63pdMV2CVG4LVDd5uR6q1qQN/7LafBZtAtNIn/mqXjsSeS5ggv/P0iECw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.3.0", - "@typescript-eslint/types": "8.3.0", - "@typescript-eslint/typescript-estree": "8.3.0" + "@typescript-eslint/scope-manager": "8.5.0", + "@typescript-eslint/types": "8.5.0", + "@typescript-eslint/typescript-estree": "8.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -938,12 +938,12 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.3.0.tgz", - "integrity": "sha512-RmZwrTbQ9QveF15m/Cl28n0LXD6ea2CjkhH5rQ55ewz3H24w+AMCJHPVYaZ8/0HoG8Z3cLLFFycRXxeO2tz9FA==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.5.0.tgz", + "integrity": "sha512-yTPqMnbAZJNy2Xq2XU8AdtOW9tJIr+UQb64aXB9f3B1498Zx9JorVgFJcZpEc9UBuCCrdzKID2RGAMkYcDtZOw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "8.3.0", + "@typescript-eslint/types": "8.5.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -1077,9 +1077,9 @@ } }, "node_modules/@typespec/compiler": { - "version": "0.59.1", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.59.1.tgz", - "integrity": "sha512-O2ljgr6YoFaIH6a8lWc90/czdv4B2X6N9wz4WsnQnVvgO0Tj0s+3xkvp4Tv59RKMhT0f3fK6dL8oEGO32FYk1A==", + "version": "0.60.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.60.0.tgz", + "integrity": "sha512-qAS99tJv6RvxSescfxRVal4QWSfdf3BzIOgE8+Az6emL68aTE/W8zQ0Ijpgmhax7sC2AnLTxCK1tM9kj1YguRw==", "dev": true, "dependencies": { "@babel/code-frame": "~7.24.7", @@ -1147,65 +1147,65 @@ } }, "node_modules/@typespec/http": { - "version": "0.59.1", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.59.1.tgz", - "integrity": "sha512-Ai8oCAO+Bw1HMSZ9gOI5Od4fNn/ul4HrVtTB01xFuLK6FQj854pxhzao8ylPnr7gIRQ327FV12/QfXR87yCiYQ==", + "version": "0.60.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.60.0.tgz", + "integrity": "sha512-ktfS9vpHfltyeAaQLNAZdqrn6Per3vmB/HDH/iyudYLA5wWblT1siKvpFCMWq53CJorRO7yeOKv+Q/M26zwEtg==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.59.0" + "@typespec/compiler": "~0.60.0" } }, "node_modules/@typespec/openapi": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.59.0.tgz", - "integrity": "sha512-do1Dm5w0MuK3994gYTBg6qMfgeIxmmsDqnz3zimYKMPpbnUBi4F6/o4iCfn0Fn9kaNl+H6UlOzZpsZW9xHui1Q==", + "version": "0.60.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.60.0.tgz", + "integrity": "sha512-YVwLppgHY8r/MudHNSLSUXzdw+CIpjmb31gI2a0KDGnI6sWDwY7LSWfjGU4TY/ubt0+X0Tjoy330mTvw71YBTg==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.59.0", - "@typespec/http": "~0.59.0" + "@typespec/compiler": "~0.60.0", + "@typespec/http": "~0.60.0" } }, "node_modules/@typespec/rest": { - "version": "0.59.1", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.59.1.tgz", - "integrity": "sha512-uKU431jBYL2tVQWG5THA75+OtXDa1e8cMAafYK/JJRRiVRd8D/Epd8fp07dzlB8tFGrhCaGlekRMqFPFrHh2/A==", + "version": "0.60.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.60.0.tgz", + "integrity": "sha512-mHYubyuBvwdV2xkHrJfPwV7b/Ksyb9lA1Q/AQwpVFa7Qu1X075TBVALmH+hK3V0EdUG1CGJZ5Sw4BWgl8ZS0BA==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.59.0", - "@typespec/http": "~0.59.1" + "@typespec/compiler": "~0.60.0", + "@typespec/http": "~0.60.0" } }, "node_modules/@typespec/versioning": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.59.0.tgz", - "integrity": "sha512-aihO/ux0lLmsuYAdGVkiBflSudcZokYG42SELk1FtMFo609G3Pd7ep7hau6unBnMIceQZejB0ow5UGRupK4X5A==", + "version": "0.60.1", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.60.1.tgz", + "integrity": "sha512-HogYL7P9uOPoSvkLLDjF22S6E9td6EY3c6TcIHhCzDTAQoi54csikD0gNrtcCkFG0UeQk29HgQymV397j+vp4g==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.59.0" + "@typespec/compiler": "~0.60.0" } }, "node_modules/@typespec/xml": { - "version": "0.59.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.59.0.tgz", - "integrity": "sha512-UoSsEmm7SXEtL9OXsqotu1TjruJSobqZMhUKAAlC9EP2WfQIHLRfBu7xaZB0sgwq7CM6zy/Hq1RZfQyL1KqEvg==", + "version": "0.60.0", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.60.0.tgz", + "integrity": "sha512-Cr1Vih4ovB1OKHJNrXf23Bq4IiVNGlf7F6kN5Yfc7UDqxy+hiCfuwXfjlu3ida/bYTalGPd4/KL9EAx+m41Bxw==", "dev": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.59.0" + "@typespec/compiler": "~0.60.0" } }, "node_modules/@ungap/structured-clone": { @@ -3331,9 +3331,9 @@ } }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/typespec-extension/package.json b/typespec-extension/package.json index ffac025710..7044641362 100644 --- a/typespec-extension/package.json +++ b/typespec-extension/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-java", - "version": "0.20.2", + "version": "0.20.3", "description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding", "keywords": [ "TypeSpec" @@ -45,17 +45,17 @@ "generator/http-client-generator/target/emitter.jar" ], "peerDependencies": { - "@azure-tools/typespec-azure-core": ">=0.45.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.45.0 <1.0.0", - "@azure-tools/typespec-autorest": ">=0.45.0 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.45.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.45.4 <1.0.0", - "@typespec/compiler": ">=0.59.0 <1.0.0", - "@typespec/http": ">=0.59.0 <1.0.0", - "@typespec/openapi": ">=0.59.0 <1.0.0", - "@typespec/rest": ">=0.59.0 <1.0.0", - "@typespec/versioning": ">=0.59.0 <1.0.0", - "@typespec/xml": ">=0.59.0 <1.0.0" + "@azure-tools/typespec-azure-core": ">=0.46.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.46.0 <1.0.0", + "@azure-tools/typespec-autorest": ">=0.46.0 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">=0.46.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.46.0 <1.0.0", + "@typespec/compiler": ">=0.60.0 <1.0.0", + "@typespec/http": ">=0.60.0 <1.0.0", + "@typespec/openapi": ">=0.60.0 <1.0.0", + "@typespec/rest": ">=0.60.0 <1.0.0", + "@typespec/versioning": ">=0.60.0 <1.0.0", + "@typespec/xml": ">=0.60.0 <1.0.0" }, "dependencies": { "@autorest/codemodel": "~4.20.0", @@ -63,29 +63,29 @@ "lodash": "~4.17.21" }, "devDependencies": { - "@azure-tools/typespec-azure-core": "0.45.0", - "@azure-tools/typespec-azure-resource-manager": "0.45.0", - "@azure-tools/typespec-autorest": "0.45.0", - "@azure-tools/typespec-azure-rulesets": "0.45.0", - "@azure-tools/typespec-client-generator-core": "0.45.4", + "@azure-tools/typespec-azure-core": "0.46.0", + "@azure-tools/typespec-azure-resource-manager": "0.46.0", + "@azure-tools/typespec-autorest": "0.46.0", + "@azure-tools/typespec-azure-rulesets": "0.46.0", + "@azure-tools/typespec-client-generator-core": "0.46.0", "@types/js-yaml": "~4.0.9", "@types/lodash": "~4.17.7", "@types/mocha": "~10.0.7", - "@types/node": "~22.5.1", - "@typescript-eslint/eslint-plugin": "~8.3.0", - "@typescript-eslint/parser": "~8.3.0", - "@typespec/compiler": "0.59.1", - "@typespec/http": "0.59.1", - "@typespec/openapi": "0.59.0", - "@typespec/rest": "0.59.1", - "@typespec/versioning": "0.59.0", - "@typespec/xml": "0.59.0", + "@types/node": "~22.5.4", + "@typescript-eslint/eslint-plugin": "~8.5.0", + "@typescript-eslint/parser": "~8.5.0", + "@typespec/compiler": "0.60.0", + "@typespec/http": "0.60.0", + "@typespec/openapi": "0.60.0", + "@typespec/rest": "0.60.0", + "@typespec/versioning": "0.60.1", + "@typespec/xml": "0.60.0", "c8": "~10.1.2", "eslint": "~8.57.0", "eslint-plugin-deprecation": "~3.0.0", "mocha": "~10.7.3", "prettier": "~3.3.3", "rimraf": "~6.0.1", - "typescript": "~5.5.4" + "typescript": "~5.6.2" } } diff --git a/typespec-extension/readme.md b/typespec-extension/readme.md index 892884b91a..b2b317d858 100644 --- a/typespec-extension/readme.md +++ b/typespec-extension/readme.md @@ -1,10 +1,10 @@ # Prerequisite -Install [Node.js](https://nodejs.org/en/download/) 16 or above. (Verify by `node --version`) +Install [Node.js](https://nodejs.org/en/download/) 20 or above. (Verify by `node --version`) Install [Java](https://docs.microsoft.com/java/openjdk/download) 11 or above. (Verify by `java --version`) -Install [TypeSpec](https://github.com/microsoft/typespec/) 0.59. +Install [TypeSpec](https://github.com/microsoft/typespec/) 0.60. # Initialize TypeSpec Project diff --git a/typespec-tests/package.json b/typespec-tests/package.json index 4d8f8c695c..57002ae6e3 100644 --- a/typespec-tests/package.json +++ b/typespec-tests/package.json @@ -10,24 +10,24 @@ }, "dependencies": { "@azure-tools/cadl-ranch-specs": "0.37.1", - "@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.20.2.tgz" + "@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.20.3.tgz" }, "devDependencies": { - "@typespec/prettier-plugin-typespec": "~0.59.0", + "@typespec/prettier-plugin-typespec": "~0.60.0", "prettier-plugin-organize-imports": "4.0.0", "prettier": "~3.3.3" }, "overrides": { - "@typespec/compiler": "~0.59.0", - "@typespec/http": "~0.59.0", - "@typespec/rest": "~0.59.0", - "@typespec/versioning": "~0.59.0", - "@typespec/openapi": "~0.59.0", - "@typespec/xml": "~0.59.0", - "@azure-tools/typespec-azure-core": "~0.45.0", - "@azure-tools/typespec-client-generator-core": "~0.45.0", - "@azure-tools/typespec-azure-resource-manager": "~0.45.0", - "@azure-tools/typespec-autorest": "~0.45.0" + "@typespec/compiler": "~0.60.0", + "@typespec/http": "~0.60.0", + "@typespec/rest": "~0.60.0", + "@typespec/versioning": "~0.60.0", + "@typespec/openapi": "~0.60.0", + "@typespec/xml": "~0.60.0", + "@azure-tools/typespec-azure-core": "~0.46.0", + "@azure-tools/typespec-client-generator-core": "~0.46.0", + "@azure-tools/typespec-azure-resource-manager": "~0.46.0", + "@azure-tools/typespec-autorest": "~0.46.0" }, "private": true } From 56b7403ccb0b136840e12c40b5f23a74fd383762 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 12 Sep 2024 17:07:15 +0800 Subject: [PATCH 3/9] eng --- .github/workflows/fluent-test-gen-all.yml | 5 ++++- .github/workflows/generate-test-code.yml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/fluent-test-gen-all.yml b/.github/workflows/fluent-test-gen-all.yml index ddbd84681f..1b094fe4d5 100644 --- a/.github/workflows/fluent-test-gen-all.yml +++ b/.github/workflows/fluent-test-gen-all.yml @@ -19,6 +19,9 @@ jobs: steps: - name: Checkout branch uses: actions/checkout@v4 + with: + submodules: 'true' + token: ${{ secrets.PAT_TOKEN }} - name: Checkout azure-rest-api-specs uses: actions/checkout@v4 @@ -26,7 +29,7 @@ jobs: repository: azure/azure-rest-api-specs path: azure-rest-api-specs - - name: Setup node.js 20 + - name: Install node.js uses: actions/setup-node@v4 with: node-version: '20' diff --git a/.github/workflows/generate-test-code.yml b/.github/workflows/generate-test-code.yml index 7cc092c48a..a9afbfe4f4 100644 --- a/.github/workflows/generate-test-code.yml +++ b/.github/workflows/generate-test-code.yml @@ -29,8 +29,10 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + submodules: 'true' + token: ${{ secrets.PAT_TOKEN }} - - name: Setup node 20 + - name: Install node uses: actions/setup-node@v4 with: node-version: '20' From ae8e00bc60b7b3600d5fc0d7e0bfdb1fd0fd8183 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 12 Sep 2024 17:10:21 +0800 Subject: [PATCH 4/9] sync cadl-ranch --- .../com/cadl/naming/NamingClientBuilder.java | 287 ++++++++++++++++++ .../naming/implementation/NamingOpsImpl.java | 273 +++++++++++++++++ .../naming/implementation}/package-info.java | 6 +- .../com/cadl/naming/models/package-info.java | 11 + .../java/com/cadl/naming/package-info.java | 11 + .../BodyOptionalityAsyncClient.java | 14 +- .../BodyOptionalityClient.java | 14 +- .../BodyOptionalityClientImpl.java | 27 +- .../models/RequiredImplicitRequest.java | 83 ----- .../parameters/spread/ModelAsyncClient.java | 13 +- .../com/parameters/spread/ModelClient.java | 14 +- .../spread/implementation/ModelsImpl.java | 25 +- .../models/SpreadAsRequestBodyRequest1.java | 83 ----- .../src/main/resources/cadl-naming.properties | 2 + 14 files changed, 633 insertions(+), 230 deletions(-) create mode 100644 typespec-tests/src/main/java/com/cadl/naming/NamingClientBuilder.java create mode 100644 typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java rename typespec-tests/src/main/java/com/{parameters/bodyoptionality/implementation/models => cadl/naming/implementation}/package-info.java (56%) create mode 100644 typespec-tests/src/main/java/com/cadl/naming/models/package-info.java create mode 100644 typespec-tests/src/main/java/com/cadl/naming/package-info.java delete mode 100644 typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/models/RequiredImplicitRequest.java delete mode 100644 typespec-tests/src/main/java/com/parameters/spread/implementation/models/SpreadAsRequestBodyRequest1.java create mode 100644 typespec-tests/src/main/resources/cadl-naming.properties diff --git a/typespec-tests/src/main/java/com/cadl/naming/NamingClientBuilder.java b/typespec-tests/src/main/java/com/cadl/naming/NamingClientBuilder.java new file mode 100644 index 0000000000..f1c45ce599 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/naming/NamingClientBuilder.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.naming; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import com.cadl.naming.implementation.NamingClientImpl; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the NamingClient type. + */ +@ServiceClientBuilder(serviceClients = { NamingClient.class, NamingAsyncClient.class }) +public final class NamingClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final Map PROPERTIES = CoreUtils.getProperties("cadl-naming.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the NamingClientBuilder. + */ + @Generated + public NamingClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NamingClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NamingClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NamingClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NamingClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NamingClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NamingClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NamingClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public NamingClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the NamingClientBuilder. + */ + @Generated + public NamingClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of NamingClientImpl with the provided parameters. + * + * @return an instance of NamingClientImpl. + */ + @Generated + private NamingClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + NamingClientImpl client + = new NamingClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint); + return client; + } + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of NamingAsyncClient class. + * + * @return an instance of NamingAsyncClient. + */ + @Generated + public NamingAsyncClient buildAsyncClient() { + return new NamingAsyncClient(buildInnerClient().getNamingOps()); + } + + /** + * Builds an instance of NamingClient class. + * + * @return an instance of NamingClient. + */ + @Generated + public NamingClient buildClient() { + return new NamingClient(buildInnerClient().getNamingOps()); + } + + private static final ClientLogger LOGGER = new ClientLogger(NamingClientBuilder.class); +} diff --git a/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java new file mode 100644 index 0000000000..5ec21c69f9 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/naming/implementation/NamingOpsImpl.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.cadl.naming.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in NamingOps. + */ +public final class NamingOpsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final NamingOpsService service; + + /** + * The service client containing this operation class. + */ + private final NamingClientImpl client; + + /** + * Initializes an instance of NamingOpsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NamingOpsImpl(NamingClientImpl client) { + this.service + = RestProxy.create(NamingOpsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for NamingClientNamingOps to be used by the proxy service to perform REST + * calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "NamingClientNamingOp") + public interface NamingOpsService { + @Post("/naming") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> post(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Post("/naming") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response postSync(@HostParam("endpoint") String endpoint, @QueryParam("name") String name, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData body, RequestOptions requestOptions, Context context); + + @Get("/naming") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getAnonymous(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/naming") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getAnonymousSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * summary of POST op + * + * description of POST op. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
etagStringNosummary of etag header parameter + * + * description of etag header parameter
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     parameters (Optional): {
+     *         type: String(Type1/Type2) (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     data (Required): {
+     *         data (Required): {
+     *             @data.kind: String (Required)
+     *         }
+     *     }
+     *     type: String(Blob/File) (Required)
+     *     status: String(Running/Completed/Failed) (Required)
+     *     anonymous (Required): {
+     *         last_error (Required): {
+     *             code: String(server_error/rate_limit_exceeded/invalid_prompt) (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name summary of name query parameter + * + * description of name query parameter. + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return summary of Response along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> postWithResponseAsync(String name, BinaryData body, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.post(this.client.getEndpoint(), name, contentType, accept, body, + requestOptions, context)); + } + + /** + * summary of POST op + * + * description of POST op. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
etagStringNosummary of etag header parameter + * + * description of etag header parameter
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
{@code
+     * {
+     *     parameters (Optional): {
+     *         type: String(Type1/Type2) (Required)
+     *     }
+     * }
+     * }
+ * + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     *     data (Required): {
+     *         data (Required): {
+     *             @data.kind: String (Required)
+     *         }
+     *     }
+     *     type: String(Blob/File) (Required)
+     *     status: String(Running/Completed/Failed) (Required)
+     *     anonymous (Required): {
+     *         last_error (Required): {
+     *             code: String(server_error/rate_limit_exceeded/invalid_prompt) (Required)
+     *         }
+     *     }
+     * }
+     * }
+ * + * @param name summary of name query parameter + * + * description of name query parameter. + * @param body The body parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return summary of Response along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response postWithResponse(String name, BinaryData body, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.postSync(this.client.getEndpoint(), name, contentType, accept, body, requestOptions, + Context.NONE); + } + + /** + * The getAnonymous operation. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAnonymousWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getAnonymous(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The getAnonymous operation. + *

Response Body Schema

+ * + *
{@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAnonymousWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getAnonymousSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } +} diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/models/package-info.java b/typespec-tests/src/main/java/com/cadl/naming/implementation/package-info.java similarity index 56% rename from typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/models/package-info.java rename to typespec-tests/src/main/java/com/cadl/naming/implementation/package-info.java index 5c9f425dcb..e39e9cae6d 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/models/package-info.java +++ b/typespec-tests/src/main/java/com/cadl/naming/implementation/package-info.java @@ -4,8 +4,8 @@ /** * - * Package containing the data models for BodyOptionality. - * Test describing optionality of the request body. + * Package containing the implementations for Naming. + * description of Naming. * */ -package com.parameters.bodyoptionality.implementation.models; +package com.cadl.naming.implementation; diff --git a/typespec-tests/src/main/java/com/cadl/naming/models/package-info.java b/typespec-tests/src/main/java/com/cadl/naming/models/package-info.java new file mode 100644 index 0000000000..41c7303262 --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/naming/models/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the data models for Naming. + * description of Naming. + * + */ +package com.cadl.naming.models; diff --git a/typespec-tests/src/main/java/com/cadl/naming/package-info.java b/typespec-tests/src/main/java/com/cadl/naming/package-info.java new file mode 100644 index 0000000000..12cf7f737c --- /dev/null +++ b/typespec-tests/src/main/java/com/cadl/naming/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the classes for Naming. + * description of Naming. + * + */ +package com.cadl.naming; diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityAsyncClient.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityAsyncClient.java index f06a21f593..79fc03bcdd 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityAsyncClient.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityAsyncClient.java @@ -17,7 +17,6 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; import com.parameters.bodyoptionality.implementation.BodyOptionalityClientImpl; -import com.parameters.bodyoptionality.implementation.models.RequiredImplicitRequest; import com.parameters.bodyoptionality.models.BodyModel; import reactor.core.publisher.Mono; @@ -73,7 +72,7 @@ public Mono> requiredExplicitWithResponse(BinaryData body, Reques * } * } * - * @param requiredImplicitRequest The requiredImplicitRequest parameter. + * @param bodyModel The bodyModel parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -83,9 +82,8 @@ public Mono> requiredExplicitWithResponse(BinaryData body, Reques */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> requiredImplicitWithResponse(BinaryData requiredImplicitRequest, - RequestOptions requestOptions) { - return this.serviceClient.requiredImplicitWithResponseAsync(requiredImplicitRequest, requestOptions); + public Mono> requiredImplicitWithResponse(BinaryData bodyModel, RequestOptions requestOptions) { + return this.serviceClient.requiredImplicitWithResponseAsync(bodyModel, requestOptions); } /** @@ -125,8 +123,8 @@ public Mono requiredExplicit(BodyModel body) { public Mono requiredImplicit(String name) { // Generated convenience method for requiredImplicitWithResponse RequestOptions requestOptions = new RequestOptions(); - RequiredImplicitRequest requiredImplicitRequestObj = new RequiredImplicitRequest(name); - BinaryData requiredImplicitRequest = BinaryData.fromObject(requiredImplicitRequestObj); - return requiredImplicitWithResponse(requiredImplicitRequest, requestOptions).flatMap(FluxUtil::toMono); + BodyModel bodyModelObj = new BodyModel(name); + BinaryData bodyModel = BinaryData.fromObject(bodyModelObj); + return requiredImplicitWithResponse(bodyModel, requestOptions).flatMap(FluxUtil::toMono); } } diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClient.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClient.java index ee0d67d69c..f4cdf489f2 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClient.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/BodyOptionalityClient.java @@ -16,7 +16,6 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.parameters.bodyoptionality.implementation.BodyOptionalityClientImpl; -import com.parameters.bodyoptionality.implementation.models.RequiredImplicitRequest; import com.parameters.bodyoptionality.models.BodyModel; /** @@ -71,7 +70,7 @@ public Response requiredExplicitWithResponse(BinaryData body, RequestOptio * } * } * - * @param requiredImplicitRequest The requiredImplicitRequest parameter. + * @param bodyModel The bodyModel parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -81,9 +80,8 @@ public Response requiredExplicitWithResponse(BinaryData body, RequestOptio */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response requiredImplicitWithResponse(BinaryData requiredImplicitRequest, - RequestOptions requestOptions) { - return this.serviceClient.requiredImplicitWithResponse(requiredImplicitRequest, requestOptions); + public Response requiredImplicitWithResponse(BinaryData bodyModel, RequestOptions requestOptions) { + return this.serviceClient.requiredImplicitWithResponse(bodyModel, requestOptions); } /** @@ -121,8 +119,8 @@ public void requiredExplicit(BodyModel body) { public void requiredImplicit(String name) { // Generated convenience method for requiredImplicitWithResponse RequestOptions requestOptions = new RequestOptions(); - RequiredImplicitRequest requiredImplicitRequestObj = new RequiredImplicitRequest(name); - BinaryData requiredImplicitRequest = BinaryData.fromObject(requiredImplicitRequestObj); - requiredImplicitWithResponse(requiredImplicitRequest, requestOptions).getValue(); + BodyModel bodyModelObj = new BodyModel(name); + BinaryData bodyModel = BinaryData.fromObject(bodyModelObj); + requiredImplicitWithResponse(bodyModel, requestOptions).getValue(); } } diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java index 56a73fd13b..9388cdaedf 100644 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java +++ b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/BodyOptionalityClientImpl.java @@ -167,9 +167,8 @@ Response requiredExplicitSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> requiredImplicit(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData requiredImplicitRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData bodyModel, + RequestOptions requestOptions, Context context); @Post("/parameters/body-optionality/required-implicit") @ExpectedResponses({ 204 }) @@ -178,9 +177,8 @@ Mono> requiredImplicit(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response requiredImplicitSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData requiredImplicitRequest, RequestOptions requestOptions, - Context context); + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData bodyModel, + RequestOptions requestOptions, Context context); } /** @@ -242,7 +240,7 @@ public Response requiredExplicitWithResponse(BinaryData body, RequestOptio * } * } * - * @param requiredImplicitRequest The requiredImplicitRequest parameter. + * @param bodyModel The bodyModel parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -251,11 +249,10 @@ public Response requiredExplicitWithResponse(BinaryData body, RequestOptio * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> requiredImplicitWithResponseAsync(BinaryData requiredImplicitRequest, - RequestOptions requestOptions) { + public Mono> requiredImplicitWithResponseAsync(BinaryData bodyModel, RequestOptions requestOptions) { final String contentType = "application/json"; - return FluxUtil.withContext(context -> service.requiredImplicit(this.getEndpoint(), contentType, - requiredImplicitRequest, requestOptions, context)); + return FluxUtil.withContext( + context -> service.requiredImplicit(this.getEndpoint(), contentType, bodyModel, requestOptions, context)); } /** @@ -268,7 +265,7 @@ public Mono> requiredImplicitWithResponseAsync(BinaryData require * } * } * - * @param requiredImplicitRequest The requiredImplicitRequest parameter. + * @param bodyModel The bodyModel parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -277,10 +274,8 @@ public Mono> requiredImplicitWithResponseAsync(BinaryData require * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response requiredImplicitWithResponse(BinaryData requiredImplicitRequest, - RequestOptions requestOptions) { + public Response requiredImplicitWithResponse(BinaryData bodyModel, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.requiredImplicitSync(this.getEndpoint(), contentType, requiredImplicitRequest, requestOptions, - Context.NONE); + return service.requiredImplicitSync(this.getEndpoint(), contentType, bodyModel, requestOptions, Context.NONE); } } diff --git a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/models/RequiredImplicitRequest.java b/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/models/RequiredImplicitRequest.java deleted file mode 100644 index ede65f22dd..0000000000 --- a/typespec-tests/src/main/java/com/parameters/bodyoptionality/implementation/models/RequiredImplicitRequest.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.parameters.bodyoptionality.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The RequiredImplicitRequest model. - */ -@Immutable -public final class RequiredImplicitRequest implements JsonSerializable { - /* - * The name property. - */ - @Generated - private final String name; - - /** - * Creates an instance of RequiredImplicitRequest class. - * - * @param name the name value to set. - */ - @Generated - public RequiredImplicitRequest(String name) { - this.name = name; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of RequiredImplicitRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of RequiredImplicitRequest if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the RequiredImplicitRequest. - */ - @Generated - public static RequiredImplicitRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String name = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - name = reader.getString(); - } else { - reader.skipChildren(); - } - } - return new RequiredImplicitRequest(name); - }); - } -} diff --git a/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java b/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java index d119735f9f..9e583fcee8 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/ModelAsyncClient.java @@ -17,7 +17,6 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; import com.parameters.spread.implementation.ModelsImpl; -import com.parameters.spread.implementation.models.SpreadAsRequestBodyRequest1; import com.parameters.spread.implementation.models.SpreadCompositeRequestMixRequest; import com.parameters.spread.models.BodyParameter; import reactor.core.publisher.Mono; @@ -50,7 +49,7 @@ public final class ModelAsyncClient { * } * } * - * @param spreadAsRequestBodyRequest1 The spreadAsRequestBodyRequest1 parameter. + * @param bodyParameter The bodyParameter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -60,9 +59,9 @@ public final class ModelAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> spreadAsRequestBodyWithResponse(BinaryData spreadAsRequestBodyRequest1, + public Mono> spreadAsRequestBodyWithResponse(BinaryData bodyParameter, RequestOptions requestOptions) { - return this.serviceClient.spreadAsRequestBodyWithResponseAsync(spreadAsRequestBodyRequest1, requestOptions); + return this.serviceClient.spreadAsRequestBodyWithResponseAsync(bodyParameter, requestOptions); } /** @@ -181,9 +180,9 @@ public Mono> spreadCompositeRequestMixWithResponse(String name, S public Mono spreadAsRequestBody(String name) { // Generated convenience method for spreadAsRequestBodyWithResponse RequestOptions requestOptions = new RequestOptions(); - SpreadAsRequestBodyRequest1 spreadAsRequestBodyRequest1Obj = new SpreadAsRequestBodyRequest1(name); - BinaryData spreadAsRequestBodyRequest1 = BinaryData.fromObject(spreadAsRequestBodyRequest1Obj); - return spreadAsRequestBodyWithResponse(spreadAsRequestBodyRequest1, requestOptions).flatMap(FluxUtil::toMono); + BodyParameter bodyParameterObj = new BodyParameter(name); + BinaryData bodyParameter = BinaryData.fromObject(bodyParameterObj); + return spreadAsRequestBodyWithResponse(bodyParameter, requestOptions).flatMap(FluxUtil::toMono); } /** diff --git a/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java b/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java index 197a341c12..4fa5c72343 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java +++ b/typespec-tests/src/main/java/com/parameters/spread/ModelClient.java @@ -16,7 +16,6 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.parameters.spread.implementation.ModelsImpl; -import com.parameters.spread.implementation.models.SpreadAsRequestBodyRequest1; import com.parameters.spread.implementation.models.SpreadCompositeRequestMixRequest; import com.parameters.spread.models.BodyParameter; @@ -48,7 +47,7 @@ public final class ModelClient { * } * } * - * @param spreadAsRequestBodyRequest1 The spreadAsRequestBodyRequest1 parameter. + * @param bodyParameter The bodyParameter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -58,9 +57,8 @@ public final class ModelClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequestBodyRequest1, - RequestOptions requestOptions) { - return this.serviceClient.spreadAsRequestBodyWithResponse(spreadAsRequestBodyRequest1, requestOptions); + public Response spreadAsRequestBodyWithResponse(BinaryData bodyParameter, RequestOptions requestOptions) { + return this.serviceClient.spreadAsRequestBodyWithResponse(bodyParameter, requestOptions); } /** @@ -178,9 +176,9 @@ public Response spreadCompositeRequestMixWithResponse(String name, String public void spreadAsRequestBody(String name) { // Generated convenience method for spreadAsRequestBodyWithResponse RequestOptions requestOptions = new RequestOptions(); - SpreadAsRequestBodyRequest1 spreadAsRequestBodyRequest1Obj = new SpreadAsRequestBodyRequest1(name); - BinaryData spreadAsRequestBodyRequest1 = BinaryData.fromObject(spreadAsRequestBodyRequest1Obj); - spreadAsRequestBodyWithResponse(spreadAsRequestBodyRequest1, requestOptions).getValue(); + BodyParameter bodyParameterObj = new BodyParameter(name); + BinaryData bodyParameter = BinaryData.fromObject(bodyParameterObj); + spreadAsRequestBodyWithResponse(bodyParameter, requestOptions).getValue(); } /** diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java index bd8d00820e..7b1e891174 100644 --- a/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java +++ b/typespec-tests/src/main/java/com/parameters/spread/implementation/ModelsImpl.java @@ -65,9 +65,8 @@ public interface ModelsService { @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> spreadAsRequestBody(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest1, RequestOptions requestOptions, - Context context); + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData bodyParameter, + RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/request-body") @ExpectedResponses({ 204 }) @@ -76,9 +75,8 @@ Mono> spreadAsRequestBody(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response spreadAsRequestBodySync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, - @BodyParam("application/json") BinaryData spreadAsRequestBodyRequest1, RequestOptions requestOptions, - Context context); + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") BinaryData bodyParameter, + RequestOptions requestOptions, Context context); @Put("/parameters/spread/model/composite-request-only-with-body") @ExpectedResponses({ 204 }) @@ -177,7 +175,7 @@ Response spreadCompositeRequestMixSync(@HostParam("endpoint") String endpo * } * } * - * @param spreadAsRequestBodyRequest1 The spreadAsRequestBodyRequest1 parameter. + * @param bodyParameter The bodyParameter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -186,11 +184,11 @@ Response spreadCompositeRequestMixSync(@HostParam("endpoint") String endpo * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spreadAsRequestBodyRequest1, + public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData bodyParameter, RequestOptions requestOptions) { final String contentType = "application/json"; return FluxUtil.withContext(context -> service.spreadAsRequestBody(this.client.getEndpoint(), contentType, - spreadAsRequestBodyRequest1, requestOptions, context)); + bodyParameter, requestOptions, context)); } /** @@ -203,7 +201,7 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spre * } * } * - * @param spreadAsRequestBodyRequest1 The spreadAsRequestBodyRequest1 parameter. + * @param bodyParameter The bodyParameter parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -212,11 +210,10 @@ public Mono> spreadAsRequestBodyWithResponseAsync(BinaryData spre * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response spreadAsRequestBodyWithResponse(BinaryData spreadAsRequestBodyRequest1, - RequestOptions requestOptions) { + public Response spreadAsRequestBodyWithResponse(BinaryData bodyParameter, RequestOptions requestOptions) { final String contentType = "application/json"; - return service.spreadAsRequestBodySync(this.client.getEndpoint(), contentType, spreadAsRequestBodyRequest1, - requestOptions, Context.NONE); + return service.spreadAsRequestBodySync(this.client.getEndpoint(), contentType, bodyParameter, requestOptions, + Context.NONE); } /** diff --git a/typespec-tests/src/main/java/com/parameters/spread/implementation/models/SpreadAsRequestBodyRequest1.java b/typespec-tests/src/main/java/com/parameters/spread/implementation/models/SpreadAsRequestBodyRequest1.java deleted file mode 100644 index 6117089542..0000000000 --- a/typespec-tests/src/main/java/com/parameters/spread/implementation/models/SpreadAsRequestBodyRequest1.java +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package com.parameters.spread.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The SpreadAsRequestBodyRequest1 model. - */ -@Immutable -public final class SpreadAsRequestBodyRequest1 implements JsonSerializable { - /* - * The name property. - */ - @Generated - private final String name; - - /** - * Creates an instance of SpreadAsRequestBodyRequest1 class. - * - * @param name the name value to set. - */ - @Generated - public SpreadAsRequestBodyRequest1(String name) { - this.name = name; - } - - /** - * Get the name property: The name property. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SpreadAsRequestBodyRequest1 from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SpreadAsRequestBodyRequest1 if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SpreadAsRequestBodyRequest1. - */ - @Generated - public static SpreadAsRequestBodyRequest1 fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String name = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - name = reader.getString(); - } else { - reader.skipChildren(); - } - } - return new SpreadAsRequestBodyRequest1(name); - }); - } -} diff --git a/typespec-tests/src/main/resources/cadl-naming.properties b/typespec-tests/src/main/resources/cadl-naming.properties new file mode 100644 index 0000000000..ca812989b4 --- /dev/null +++ b/typespec-tests/src/main/resources/cadl-naming.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} From 44996b4835cf3359960649c415422a3bb5c0e99d Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 12 Sep 2024 17:11:31 +0800 Subject: [PATCH 5/9] eng --- .github/workflows/generate-test-code.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/generate-test-code.yml b/.github/workflows/generate-test-code.yml index a9afbfe4f4..032f4d055e 100644 --- a/.github/workflows/generate-test-code.yml +++ b/.github/workflows/generate-test-code.yml @@ -48,6 +48,13 @@ jobs: distribution: 'zulu' java-version: '11' + - name: Patch core + run: | + cd core + git checkout . + git apply ../core.diff --ignore-whitespace + cd .. + - name: Build autorest-java, install modules run: | mvn install -f pom.xml -P local,tsp --no-transfer-progress From f657b6f5b4da729f3f31e697a5fdd9e4baf4f81b Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 12 Sep 2024 17:19:47 +0800 Subject: [PATCH 6/9] remove token --- .github/workflows/fluent-test-gen-all.yml | 3 +-- .github/workflows/generate-test-code.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fluent-test-gen-all.yml b/.github/workflows/fluent-test-gen-all.yml index 1b094fe4d5..86e5de7513 100644 --- a/.github/workflows/fluent-test-gen-all.yml +++ b/.github/workflows/fluent-test-gen-all.yml @@ -20,8 +20,7 @@ jobs: - name: Checkout branch uses: actions/checkout@v4 with: - submodules: 'true' - token: ${{ secrets.PAT_TOKEN }} + submodules: 'true' - name: Checkout azure-rest-api-specs uses: actions/checkout@v4 diff --git a/.github/workflows/generate-test-code.yml b/.github/workflows/generate-test-code.yml index 032f4d055e..00f8dbb983 100644 --- a/.github/workflows/generate-test-code.yml +++ b/.github/workflows/generate-test-code.yml @@ -6,7 +6,7 @@ on: type: choice description: scope of the test code to generate required: true - default: typespec + default: autorest options: - all - autorest @@ -30,7 +30,6 @@ jobs: with: fetch-depth: 0 submodules: 'true' - token: ${{ secrets.PAT_TOKEN }} - name: Install node uses: actions/setup-node@v4 From de091957cd83abb6c8d77848c5e21711479dc13c Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Sat, 14 Sep 2024 10:35:47 +0800 Subject: [PATCH 7/9] bump core and use 0.21, as 0.60 seems having more break than expected --- core | 2 +- typespec-extension/changelog.md | 2 +- typespec-extension/package-lock.json | 4 ++-- typespec-extension/package.json | 2 +- typespec-tests/package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core b/core index deae32ea6f..4b942c9fb9 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit deae32ea6fa699327310ec7608d65dfba375c0c3 +Subproject commit 4b942c9fb957c5b4e8e443a16bbdb130790a80b8 diff --git a/typespec-extension/changelog.md b/typespec-extension/changelog.md index e4e317ad4e..30666fe206 100644 --- a/typespec-extension/changelog.md +++ b/typespec-extension/changelog.md @@ -1,6 +1,6 @@ # Release History -## 0.20.2 (2024-09-13) +## 0.21.0 (2024-09-14) Compatible with compiler 0.60. diff --git a/typespec-extension/package-lock.json b/typespec-extension/package-lock.json index 3a8ae482c2..a5aa752cc1 100644 --- a/typespec-extension/package-lock.json +++ b/typespec-extension/package-lock.json @@ -1,12 +1,12 @@ { "name": "@azure-tools/typespec-java", - "version": "0.20.3", + "version": "0.21.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@azure-tools/typespec-java", - "version": "0.20.3", + "version": "0.21.0", "license": "MIT", "dependencies": { "@autorest/codemodel": "~4.20.0", diff --git a/typespec-extension/package.json b/typespec-extension/package.json index 7044641362..798ac888e9 100644 --- a/typespec-extension/package.json +++ b/typespec-extension/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-java", - "version": "0.20.3", + "version": "0.21.0", "description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding", "keywords": [ "TypeSpec" diff --git a/typespec-tests/package.json b/typespec-tests/package.json index 57002ae6e3..98d13c41c0 100644 --- a/typespec-tests/package.json +++ b/typespec-tests/package.json @@ -10,7 +10,7 @@ }, "dependencies": { "@azure-tools/cadl-ranch-specs": "0.37.1", - "@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.20.3.tgz" + "@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.21.0.tgz" }, "devDependencies": { "@typespec/prettier-plugin-typespec": "~0.60.0", From f80088309a257d727b83a375d8e42babe6b92391 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Sat, 14 Sep 2024 10:37:12 +0800 Subject: [PATCH 8/9] sync cadl-ranch --- .../models/ManagedIdentityTrackedResourceInner.java | 8 -------- .../fluent/models/SingletonTrackedResourceInner.java | 8 -------- .../fluent/models/TopLevelTrackedResourceInner.java | 8 -------- .../fluent/models/TopLevelArmResourceInner.java | 8 -------- 4 files changed, 32 deletions(-) diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java index 386af48ccc..473e219db8 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/commontypes/managedidentity/fluent/models/ManagedIdentityTrackedResourceInner.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -166,15 +165,8 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (location() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property location in model ManagedIdentityTrackedResourceInner")); - } } - private static final ClientLogger LOGGER = new ClientLogger(ManagedIdentityTrackedResourceInner.class); - /** * {@inheritDoc} */ diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/SingletonTrackedResourceInner.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/SingletonTrackedResourceInner.java index f5b4a628df..d96e1347a3 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/SingletonTrackedResourceInner.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/SingletonTrackedResourceInner.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -137,15 +136,8 @@ public void validate() { if (properties() != null) { properties().validate(); } - if (location() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property location in model SingletonTrackedResourceInner")); - } } - private static final ClientLogger LOGGER = new ClientLogger(SingletonTrackedResourceInner.class); - /** * {@inheritDoc} */ diff --git a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java index af9aad5493..156b629584 100644 --- a/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java +++ b/typespec-tests/src/main/java/com/azure/resourcemanager/models/resources/fluent/models/TopLevelTrackedResourceInner.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -137,15 +136,8 @@ public void validate() { if (properties() != null) { properties().validate(); } - if (location() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property location in model TopLevelTrackedResourceInner")); - } } - private static final ClientLogger LOGGER = new ClientLogger(TopLevelTrackedResourceInner.class); - /** * {@inheritDoc} */ diff --git a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java index b2f7aa1de2..7ca60f1eaa 100644 --- a/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java +++ b/typespec-tests/src/main/java/com/cadl/armstreamstyleserialization/fluent/models/TopLevelArmResourceInner.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -108,15 +107,8 @@ public void validate() { if (properties() != null) { properties().validate(); } - if (location() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Missing required property location in model TopLevelArmResourceInner")); - } } - private static final ClientLogger LOGGER = new ClientLogger(TopLevelArmResourceInner.class); - /** * {@inheritDoc} */ From ad16b8bcf5c9b8959466b1b8ddd832b8999a77d8 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Sat, 14 Sep 2024 10:49:42 +0800 Subject: [PATCH 9/9] bump autorest.java too --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 33195abf4b..e9997b75d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@autorest/java", - "version": "4.1.36", + "version": "4.1.37", "description": "The Java extension for classic generators in AutoRest.", "scripts": { "autorest": "autorest",