diff --git a/core b/core index a8ba8b14ad..128c1bdda2 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit a8ba8b14adf18a90c1b0ed5478b04589f0a79fc1 +Subproject commit 128c1bdda2a71b26bf16b93ad9eaaf94c388bc51 diff --git a/typespec-extension/package-lock.json b/typespec-extension/package-lock.json index e473bd2976..0ab20abb71 100644 --- a/typespec-extension/package-lock.json +++ b/typespec-extension/package-lock.json @@ -14,17 +14,17 @@ "lodash": "~4.17.23" }, "devDependencies": { - "@azure-tools/openai-typespec": "^1.7.3", + "@azure-tools/openai-typespec": "^1.8.0", "@azure-tools/typespec-autorest": "0.64.1", "@azure-tools/typespec-azure-core": "0.64.0", "@azure-tools/typespec-azure-resource-manager": "0.64.1", "@azure-tools/typespec-azure-rulesets": "0.64.0", - "@azure-tools/typespec-client-generator-core": "0.64.5", + "@azure-tools/typespec-client-generator-core": "0.64.6", "@azure-tools/typespec-liftr-base": "0.11.0", - "@microsoft/api-extractor": "^7.56.0", + "@microsoft/api-extractor": "^7.56.2", "@types/js-yaml": "~4.0.9", "@types/lodash": "~4.17.23", - "@types/node": "~25.1.0", + "@types/node": "~25.2.0", "@typescript-eslint/eslint-plugin": "~8.54.0", "@typescript-eslint/parser": "~8.54.0", "@typespec/compiler": "1.8.0", @@ -54,12 +54,12 @@ "node": ">=20.0.0" }, "peerDependencies": { - "@azure-tools/openai-typespec": "^1.7.3", + "@azure-tools/openai-typespec": "^1.8.0", "@azure-tools/typespec-autorest": ">=0.64.1 <1.0.0", "@azure-tools/typespec-azure-core": ">=0.64.0 <1.0.0", "@azure-tools/typespec-azure-resource-manager": ">=0.64.1 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.64.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.64.5 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.64.6 <1.0.0", "@azure-tools/typespec-liftr-base": ">=0.11.0 <1.0.0", "@typespec/compiler": "^1.8.0", "@typespec/http": "^1.8.0", @@ -147,9 +147,9 @@ } }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.7.3.tgz", - "integrity": "sha512-hmbYxVUXI6oYtkTeaXj8LzYZsrh5GQiQiL88YQptFyyBbq75VDA+qnak+7Sk1hxwkZqwy7+WJa8vJqWM3CSRaw==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.8.0.tgz", + "integrity": "sha512-iJRimNIbwqAF6ueYpiL5xY1GJSOA1k3NkqA1NdPlxSJ3bZLP690zR+hHTqEq95HnwqFh2feCDjof9ABtY4keWg==", "dev": true, "license": "MIT", "peerDependencies": { @@ -198,6 +198,7 @@ "integrity": "sha512-BXiHc5oayhMsG1dHFU1aFK/ZQX2Gl0dKB0FAFceapaFV9093J2obbsdhIDR3Tl0qei9g3Ha+iWKZ4KgnLdhv4w==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -213,6 +214,7 @@ "integrity": "sha512-qQV/+ZVF1h8PsTNKhmKYyb+vSCgnLA8SoGeEE1oOrevGrrp9VgtOMAZ2xIxj6DpU90QU/8t2+r5P/gcQUV1iqw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0" @@ -246,11 +248,12 @@ } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.64.5", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.64.5.tgz", - "integrity": "sha512-RaATxsnc9ztdMPoIZ2SuyH97dIGY0BWGKcJBf0hBY+8J3de9o+QH796NA9OsiW+8J9ycCEooDbh/rkAspvA4xA==", + "version": "0.64.6", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.64.6.tgz", + "integrity": "sha512-S0OH5UmIltjPdj/rdMD8RBpAQWpFP+0jjXLZSi2ARCZkhzi6++E1fEsqLLNDW7oP0CDq3RYQgpuWyCLZVtVf/A==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0", @@ -1515,9 +1518,9 @@ } }, "node_modules/@isaacs/brace-expansion": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", - "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.1.tgz", + "integrity": "sha512-WMz71T1JS624nWj2n2fnYAuPovhv7EUhk69R6i9dsVyzxt5eM3bjwvgk9L+APE1TRscGysAVMANkB0jh0LQZrQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1664,9 +1667,9 @@ } }, "node_modules/@microsoft/api-extractor": { - "version": "7.56.0", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.56.0.tgz", - "integrity": "sha512-H0V69QG5jIb9Ayx35NVBv2lOgFSS3q+Eab2oyGEy0POL3ovYPST+rCNPbwYoczOZXNG8IKjWUmmAMxmDTsXlQA==", + "version": "7.56.2", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.56.2.tgz", + "integrity": "sha512-d94f7S+H43jDxY/YIyp5UOE9N12HZmEPP5Ct96us+fw1FVKBoy4itTopdVM1VrcpduuA7fK/t31CgA2jM8AqSA==", "dev": true, "license": "MIT", "dependencies": { @@ -1676,10 +1679,10 @@ "@rushstack/node-core-library": "5.19.1", "@rushstack/rig-package": "0.6.0", "@rushstack/terminal": "0.21.0", - "@rushstack/ts-command-line": "5.1.7", + "@rushstack/ts-command-line": "5.2.0", "diff": "~8.0.2", "lodash": "~4.17.15", - "minimatch": "10.0.3", + "minimatch": "10.1.2", "resolve": "~1.22.1", "semver": "~7.5.4", "source-map": "~0.6.1", @@ -1702,13 +1705,13 @@ } }, "node_modules/@microsoft/api-extractor/node_modules/minimatch": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", - "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.2.tgz", + "integrity": "sha512-fu656aJ0n2kcXwsnwnv9g24tkU5uSmOlTjd6WyyaKm2Z+h1qmY6bAjrcaIxF/BslFqbZ8UBtbJi7KgQOZD2PTw==", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "dependencies": { - "@isaacs/brace-expansion": "^5.0.0" + "@isaacs/brace-expansion": "^5.0.1" }, "engines": { "node": "20 || >=22" @@ -2310,9 +2313,9 @@ } }, "node_modules/@rushstack/ts-command-line": { - "version": "5.1.7", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-5.1.7.tgz", - "integrity": "sha512-Ugwl6flarZcL2nqH5IXFYk3UR3mBVDsVFlCQW/Oaqidvdb/5Ota6b/Z3JXWIdqV3rOR2/JrYoAHanWF5rgenXA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-5.2.0.tgz", + "integrity": "sha512-lYxCX0nDdkDtCkVpvF0m25ymf66SaMWuppbD6b7MdkIzvGXKBXNIVZlwBH/C0YfkanrupnICWf2n4z3AKSfaHw==", "dev": true, "license": "MIT", "dependencies": { @@ -2475,11 +2478,12 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "25.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.1.0.tgz", - "integrity": "sha512-t7frlewr6+cbx+9Ohpl0NOTKXZNV9xHRmNOvql47BFJKcEG1CxtxlPEEe+gR9uhVWM4DwhnvTF110mIL4yP9RA==", + "version": "25.2.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.0.tgz", + "integrity": "sha512-DZ8VwRFUNzuqJ5khrvwMXHmvPe+zGayJhr2CDNiKB1WBE1ST8Djl00D0IC4vvNmHMdj6DlbYRIaFE7WHjlDl5w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -2549,6 +2553,7 @@ "integrity": "sha512-BtE0k6cjwjLZoZixN0t5AKP0kSzlGu7FctRXYuPAm//aaiZhmfq1JwdYpYr1brzEspYyFeF+8XF5j2VK6oalrA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.54.0", "@typescript-eslint/types": "8.54.0", @@ -2779,6 +2784,7 @@ "integrity": "sha512-FeLb7Q0z6Bh5dDpqtnU2RlWiIWWWF7rujx2xGMta5dcTuIOZ4jbdyz1hVdxk4iM4qadvaSV4ey/qrSuffNoh3w==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "~7.27.1", "@inquirer/prompts": "^8.0.1", @@ -3000,6 +3006,7 @@ "integrity": "sha512-gSI4rAexxfYyZX0ZqYNRWQyuMb1UeakjAjOeh/2ntmxWCdYc+wSbJjxrxIArsZC+LwzTxq5WpdtD7+7OWzG4yw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -3013,6 +3020,7 @@ "integrity": "sha512-ZKa4RISabwL8cUAmE3BkoNmtCYRjerO0+1Ba6XdDJKG+vJC5EGM2hkDf+ZmYsYZgrX0cvbhPXUKKh28zBV60hw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -3032,6 +3040,7 @@ "integrity": "sha512-v+RIJpx7vALBSGQmnUWemvXjnrk50HAVqJeg0RbaF3VUnh66Z4itsoNJJmIIc+HmBJng8Ie0V7xv3l02ek6HWA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -3046,6 +3055,7 @@ "integrity": "sha512-1clnDw1JbBvjLcfFvEvHdIrnsQuQI5/Cl6mRIrzWWX0pKJ+R89rCdZD1KpidEXw4B4qscD48LsssyrEIFLtuPg==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -3060,6 +3070,7 @@ "integrity": "sha512-jPARl+e1e/nsDW/1uVsGTzvKmjqezVMyUa13igXxk5nV2ScMdFpH1HhBwTmAhUeaZgY3J81dFHNUnIY67HCrmw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -3076,6 +3087,7 @@ "integrity": "sha512-wzh5bVdzh+K+pFQFs/EZkVsTH5TQGi12XwhjxJS0UKRwaW2UwSZeY1HqX07oMMPdYESTbjgMrXcxtn89AlzjvQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -3262,6 +3274,7 @@ "integrity": "sha512-I14X6+IMd0wFMNI8oMFSeFBi2nD4idub+geSO34vuCs4rwuEj3FNzy+rkNkDDvf0+gIUGxeyg7s+YDUcNyiqOA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -3275,6 +3288,7 @@ "integrity": "sha512-KSDhJX6A/Onsu9FKVZtR/xSy5va3k0y9/U4eiZUn91V/LQyMZNwmResPDHEVYk6JqaIH8bbd6ANWPu3nMd7mmw==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" }, @@ -3416,6 +3430,7 @@ "integrity": "sha512-CGJ25bc8fRi8Lod/3GHSvXRKi7nBo3kxh0ApW4yCjmrWmRmlT53B5E08XRSZRliygG0aVNxLrBEqPYdz/KcCtQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@vitest/utils": "4.0.18", "fflate": "^0.8.2", @@ -3469,6 +3484,7 @@ "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -3491,6 +3507,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -3806,6 +3823,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "baseline-browser-mapping": "^2.8.19", "caniuse-lite": "^1.0.30001751", @@ -4558,6 +4576,7 @@ "integrity": "sha512-LEyamqS7W5HB3ujJyvi0HQK/dtVINZvd5mAAp9eT5S/ujByGjiZLCzPcHVzuXbpJDJF/cxwHlfceVUDZ2lnSTw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", @@ -7930,6 +7949,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -8098,6 +8118,7 @@ "integrity": "sha512-aw45vwtwOl3QkUAmWCnLV9QW1xY+FSX2zzlit4MAfE99wX+Jij4ycnpbAWgBXsRrxmfs9LaYktg/eX5Bpthd3g==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@gerrit0/mini-shiki": "^3.9.0", "lunr": "^2.3.9", @@ -8135,6 +8156,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8283,6 +8305,7 @@ "integrity": "sha512-w+N7Hifpc3gRjZ63vYBXA56dvvRlNWRczTdmCBBa+CotUzAPf5b7YMdMR/8CQoeYE5LX3W4wj6RYTgonm1b9DA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -8376,6 +8399,7 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -8389,6 +8413,7 @@ "integrity": "sha512-hOQuK7h0FGKgBAas7v0mSAsnvrIgAvWmRFjmzpJ7SwFHH3g1k2u37JtYwOwmEKhK6ZO3v9ggDBBm0La1LCK4uQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@vitest/expect": "4.0.18", "@vitest/mocker": "4.0.18", diff --git a/typespec-extension/package.json b/typespec-extension/package.json index d248964297..b85bd4be5c 100644 --- a/typespec-extension/package.json +++ b/typespec-extension/package.json @@ -51,9 +51,9 @@ "@azure-tools/typespec-azure-core": ">=0.64.0 <1.0.0", "@azure-tools/typespec-azure-resource-manager": ">=0.64.1 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.64.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.64.5 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.64.6 <1.0.0", "@azure-tools/typespec-liftr-base": ">=0.11.0 <1.0.0", - "@azure-tools/openai-typespec": "^1.7.3", + "@azure-tools/openai-typespec": "^1.8.0", "@typespec/compiler": "^1.8.0", "@typespec/http": "^1.8.0", "@typespec/openapi": "^1.8.0", @@ -71,13 +71,13 @@ "@azure-tools/typespec-azure-core": "0.64.0", "@azure-tools/typespec-azure-resource-manager": "0.64.1", "@azure-tools/typespec-azure-rulesets": "0.64.0", - "@azure-tools/typespec-client-generator-core": "0.64.5", + "@azure-tools/typespec-client-generator-core": "0.64.6", "@azure-tools/typespec-liftr-base": "0.11.0", - "@azure-tools/openai-typespec": "^1.7.3", - "@microsoft/api-extractor": "^7.56.0", + "@azure-tools/openai-typespec": "^1.8.0", + "@microsoft/api-extractor": "^7.56.2", "@types/js-yaml": "~4.0.9", "@types/lodash": "~4.17.23", - "@types/node": "~25.1.0", + "@types/node": "~25.2.0", "@typescript-eslint/eslint-plugin": "~8.54.0", "@typescript-eslint/parser": "~8.54.0", "@typespec/compiler": "1.8.0", diff --git a/typespec-tests/package.json b/typespec-tests/package.json index fc21a14078..d676562850 100644 --- a/typespec-tests/package.json +++ b/typespec-tests/package.json @@ -31,7 +31,7 @@ "@typespec/sse": "0.78.0", "@typespec/streams": "0.78.0", "@azure-tools/typespec-azure-core": "0.64.0", - "@azure-tools/typespec-client-generator-core": "0.64.5", + "@azure-tools/typespec-client-generator-core": "0.64.6", "@azure-tools/typespec-azure-resource-manager": "0.64.1", "@azure-tools/typespec-autorest": "0.64.1", "@azure-tools/typespec-liftr-base": "0.11.0" diff --git a/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/fluent/FishesClient.java b/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/fluent/FishesClient.java index 0124cb6d51..b0aa1137be 100644 --- a/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/fluent/FishesClient.java +++ b/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/fluent/FishesClient.java @@ -20,7 +20,7 @@ public interface FishesClient { * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws tsptest.armstreamstyleserialization.models.ErrorException thrown if the request is rejected by server. + * @throws tsptest.armstreamstyleserialization.models.ErrorMaxException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return this is base model for polymorphic multiple levels inheritance with a discriminator along with * {@link Response}. @@ -31,7 +31,7 @@ public interface FishesClient { /** * The getModel operation. * - * @throws tsptest.armstreamstyleserialization.models.ErrorException thrown if the request is rejected by server. + * @throws tsptest.armstreamstyleserialization.models.ErrorMaxException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return this is base model for polymorphic multiple levels inheritance with a discriminator. */ diff --git a/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/implementation/FishesClientImpl.java b/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/implementation/FishesClientImpl.java index ab3fe57950..efb854aa78 100644 --- a/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/implementation/FishesClientImpl.java +++ b/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/implementation/FishesClientImpl.java @@ -26,7 +26,7 @@ import tsptest.armstreamstyleserialization.fluent.FishesClient; import tsptest.armstreamstyleserialization.fluent.models.FishInner; import tsptest.armstreamstyleserialization.fluent.models.OutputOnlyModelInner; -import tsptest.armstreamstyleserialization.models.ErrorException; +import tsptest.armstreamstyleserialization.models.ErrorMaxException; import tsptest.armstreamstyleserialization.models.ErrorMinException; /** @@ -63,14 +63,14 @@ public interface FishesService { @Headers({ "Content-Type: application/json" }) @Get("/model") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorException.class) + @UnexpectedResponseExceptionType(ErrorMaxException.class) Mono> getModel(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/model") @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ErrorException.class) + @UnexpectedResponseExceptionType(ErrorMaxException.class) Response getModelSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @@ -106,7 +106,7 @@ Response getOutputOnlyModelSync(@HostParam("endpoint") Str /** * The getModel operation. * - * @throws ErrorException thrown if the request is rejected by server. + * @throws ErrorMaxException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return this is base model for polymorphic multiple levels inheritance with a discriminator along with * {@link Response} on successful completion of {@link Mono}. @@ -125,7 +125,7 @@ private Mono> getModelWithResponseAsync() { /** * The getModel operation. * - * @throws ErrorException thrown if the request is rejected by server. + * @throws ErrorMaxException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return this is base model for polymorphic multiple levels inheritance with a discriminator on successful * completion of {@link Mono}. @@ -140,7 +140,7 @@ private Mono getModelAsync() { * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ErrorException thrown if the request is rejected by server. + * @throws ErrorMaxException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return this is base model for polymorphic multiple levels inheritance with a discriminator along with * {@link Response}. @@ -159,7 +159,7 @@ public Response getModelWithResponse(Context context) { /** * The getModel operation. * - * @throws ErrorException thrown if the request is rejected by server. + * @throws ErrorMaxException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return this is base model for polymorphic multiple levels inheritance with a discriminator. */ diff --git a/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/Error.java b/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/ErrorMax.java similarity index 78% rename from typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/Error.java rename to typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/ErrorMax.java index 693b29dbd7..17511bf104 100644 --- a/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/Error.java +++ b/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/ErrorMax.java @@ -14,14 +14,14 @@ import java.util.List; /** - * The Error model. + * The ErrorMax model. */ @Immutable -public final class Error extends ManagementError { +public final class ErrorMax extends ManagementError { /* * The details property. */ - private List details; + private List details; /* * The additionalProperty property. @@ -49,9 +49,9 @@ public final class Error extends ManagementError { private String code; /** - * Creates an instance of Error class. + * Creates an instance of ErrorMax class. */ - private Error() { + private ErrorMax() { } /** @@ -60,7 +60,7 @@ private Error() { * @return the details value. */ @Override - public List getDetails() { + public List getDetails() { return this.details; } @@ -134,15 +134,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of Error from the JsonReader. + * Reads an instance of ErrorMax from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of Error if the JsonReader was pointing to an instance of it, or null if it was pointing to - * JSON null. + * @return An instance of ErrorMax 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 Error. + * @throws IOException If an error occurs while reading the ErrorMax. */ - public static Error fromJson(JsonReader jsonReader) throws IOException { + public static ErrorMax fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { JsonReader bufferedReader = reader.bufferObject(); bufferedReader.nextToken(); @@ -160,33 +160,33 @@ public static Error fromJson(JsonReader jsonReader) throws IOException { }); } - private static Error readManagementError(JsonReader jsonReader) throws IOException { + private static ErrorMax readManagementError(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - Error deserializedError = new Error(); + ErrorMax deserializedErrorMax = new ErrorMax(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("code".equals(fieldName)) { - deserializedError.code = reader.getString(); + deserializedErrorMax.code = reader.getString(); } else if ("message".equals(fieldName)) { - deserializedError.message = reader.getString(); + deserializedErrorMax.message = reader.getString(); } else if ("target".equals(fieldName)) { - deserializedError.target = reader.getString(); + deserializedErrorMax.target = reader.getString(); } else if ("additionalInfo".equals(fieldName)) { List additionalInfo = reader.readArray(reader1 -> AdditionalInfo.fromJson(reader1)); - deserializedError.additionalInfo = additionalInfo; + deserializedErrorMax.additionalInfo = additionalInfo; } else if ("additionalProperty".equals(fieldName)) { - deserializedError.additionalProperty = reader.getString(); + deserializedErrorMax.additionalProperty = reader.getString(); } else if ("details".equals(fieldName)) { - List details = reader.readArray(reader1 -> Error.fromJson(reader1)); - deserializedError.details = details; + List details = reader.readArray(reader1 -> ErrorMax.fromJson(reader1)); + deserializedErrorMax.details = details; } else { reader.skipChildren(); } } - return deserializedError; + return deserializedErrorMax; }); } } diff --git a/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/ErrorException.java b/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/ErrorMaxException.java similarity index 63% rename from typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/ErrorException.java rename to typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/ErrorMaxException.java index e07c1f64bb..dd82ba35a8 100644 --- a/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/ErrorException.java +++ b/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/ErrorMaxException.java @@ -8,27 +8,27 @@ import com.azure.core.management.exception.ManagementException; /** - * Exception thrown for an invalid response with Error information. + * Exception thrown for an invalid response with ErrorMax information. */ -public final class ErrorException extends ManagementException { +public final class ErrorMaxException extends ManagementException { /** - * Initializes a new instance of the ErrorException class. + * Initializes a new instance of the ErrorMaxException class. * * @param message the exception message or the response content if a message is not available. * @param response the HTTP response. */ - public ErrorException(String message, HttpResponse response) { + public ErrorMaxException(String message, HttpResponse response) { super(message, response); } /** - * Initializes a new instance of the ErrorException class. + * Initializes a new instance of the ErrorMaxException class. * * @param message the exception message or the response content if a message is not available. * @param response the HTTP response. * @param value the deserialized response value. */ - public ErrorException(String message, HttpResponse response, Error value) { + public ErrorMaxException(String message, HttpResponse response, ErrorMax value) { super(message, response, value); } @@ -36,7 +36,7 @@ public ErrorException(String message, HttpResponse response, Error value) { * {@inheritDoc} */ @Override - public Error getValue() { - return (Error) super.getValue(); + public ErrorMax getValue() { + return (ErrorMax) super.getValue(); } } diff --git a/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/Fishes.java b/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/Fishes.java index a08020c3b2..0fdcea518e 100644 --- a/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/Fishes.java +++ b/typespec-tests/src/main/java/tsptest/armstreamstyleserialization/models/Fishes.java @@ -17,7 +17,7 @@ public interface Fishes { * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws tsptest.armstreamstyleserialization.models.ErrorException thrown if the request is rejected by server. + * @throws tsptest.armstreamstyleserialization.models.ErrorMaxException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return this is base model for polymorphic multiple levels inheritance with a discriminator along with * {@link Response}. @@ -27,7 +27,7 @@ public interface Fishes { /** * The getModel operation. * - * @throws tsptest.armstreamstyleserialization.models.ErrorException thrown if the request is rejected by server. + * @throws tsptest.armstreamstyleserialization.models.ErrorMaxException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return this is base model for polymorphic multiple levels inheritance with a discriminator. */ diff --git a/typespec-tests/src/main/resources/META-INF/native-image/com.azure.resourcemanager/armstreamstyleserialization-generated/reflect-config.json b/typespec-tests/src/main/resources/META-INF/native-image/com.azure.resourcemanager/armstreamstyleserialization-generated/reflect-config.json index 04b770df5e..5194955c3a 100644 --- a/typespec-tests/src/main/resources/META-INF/native-image/com.azure.resourcemanager/armstreamstyleserialization-generated/reflect-config.json +++ b/typespec-tests/src/main/resources/META-INF/native-image/com.azure.resourcemanager/armstreamstyleserialization-generated/reflect-config.json @@ -1 +1 @@ -[{"name":"tsptest.armstreamstyleserialization.models.Error","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"tsptest.armstreamstyleserialization.models.ErrorException","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"tsptest.armstreamstyleserialization.models.ErrorMin","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"tsptest.armstreamstyleserialization.models.ErrorMinException","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true}] \ No newline at end of file +[{"name":"tsptest.armstreamstyleserialization.models.ErrorMax","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"tsptest.armstreamstyleserialization.models.ErrorMaxException","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"tsptest.armstreamstyleserialization.models.ErrorMin","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true},{"name":"tsptest.armstreamstyleserialization.models.ErrorMinException","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true}] \ No newline at end of file diff --git a/typespec-tests/src/test/java/tsptest/armstreamstyleserialization/StreamStyleSerializationTests.java b/typespec-tests/src/test/java/tsptest/armstreamstyleserialization/StreamStyleSerializationTests.java index e60cde20dd..af56b1cdd2 100644 --- a/typespec-tests/src/test/java/tsptest/armstreamstyleserialization/StreamStyleSerializationTests.java +++ b/typespec-tests/src/test/java/tsptest/armstreamstyleserialization/StreamStyleSerializationTests.java @@ -23,7 +23,7 @@ import org.utils.ArmUtils; import reactor.core.publisher.Mono; import tsptest.armstreamstyleserialization.fluent.models.FunctionConfiguration; -import tsptest.armstreamstyleserialization.models.Error; +import tsptest.armstreamstyleserialization.models.ErrorMax; import tsptest.armstreamstyleserialization.models.Priority; import tsptest.armstreamstyleserialization.models.SawShark; import tsptest.armstreamstyleserialization.models.Shark; @@ -49,12 +49,12 @@ public void testManagementErrorDeserialization() throws IOException { final String errorBodyWithoutError = "{\"code\":\"WepAppError\",\"message\":\"Web app error.\",\"additionalProperty\":\"Deployment error.\",\"details\":[{\"code\":\"InnerError\", \"additionalProperty\": \"nested\"}]}"; SerializerAdapter serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - Error error = serializerAdapter.deserialize(errorBodyWithError, Error.class, SerializerEncoding.JSON); + ErrorMax error = serializerAdapter.deserialize(errorBodyWithError, ErrorMax.class, SerializerEncoding.JSON); Assertions.assertEquals("WepAppError", error.getCode()); Assertions.assertEquals("Deployment error.", error.getAdditionalProperty()); Assertions.assertEquals("nested", error.getDetails().iterator().next().getAdditionalProperty()); - error = serializerAdapter.deserialize(errorBodyWithoutError, Error.class, SerializerEncoding.JSON); + error = serializerAdapter.deserialize(errorBodyWithoutError, ErrorMax.class, SerializerEncoding.JSON); Assertions.assertEquals("WepAppError", error.getCode()); Assertions.assertEquals("Deployment error.", error.getAdditionalProperty()); Assertions.assertEquals("nested", error.getDetails().iterator().next().getAdditionalProperty()); diff --git a/typespec-tests/tsp/arm-stream-style-serialization.tsp b/typespec-tests/tsp/arm-stream-style-serialization.tsp index 4ae6f69c18..fc109c13e4 100644 --- a/typespec-tests/tsp/arm-stream-style-serialization.tsp +++ b/typespec-tests/tsp/arm-stream-style-serialization.tsp @@ -112,8 +112,8 @@ model TopLevelArmResourceProperties { } @error -model ErrorResponse { - error: Error; +model ErrorResponseMax { + error: ErrorMax; } @error @@ -121,11 +121,11 @@ model ErrorResponseMin { error: ErrorMin; } -model Error { +model ErrorMax { code: string; message: string; target: string; - details?: Error[]; + details?: ErrorMax[]; additionalInfo?: AdditionalInfo[]; additionalProperty: string; } @@ -222,7 +222,7 @@ union Priority { @route("/model") interface Fishes { @get - getModel(): Fish | ErrorResponse; + getModel(): Fish | ErrorResponseMax; @put putModel(@body fish: Fish): Fish | ErrorResponseMin;