Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core
Submodule core updated 69 files
+8 −0 .chronus/changes/fix-numeric-regression-2026-0-9-14-5-13.md
+7 −0 .chronus/changes/fixes-decorator-arguments-mutation-2026-0-8-13-40-11.md
+7 −0 .chronus/changes/lm-from-ide-2025-11-15-20-51-26.md
+7 −0 .chronus/changes/lm-from-ide-2025-11-15-21-3-28.md
+7 −0 .chronus/changes/nextversion-2025-11-30-10-16-46.md
+1 −0 .vscode/launch.json
+2 −2 eng/tsp-core/pipelines/jobs/publish-npm.yml
+1 −7 eng/tsp-core/pipelines/publish.yml
+66 −13 packages/compiler/src/experimental/mutators.ts
+2 −2 packages/compiler/src/server/server-compile-manager.ts
+2 −0 packages/compiler/src/server/server.ts
+2 −2 packages/compiler/src/server/update-manager.ts
+11 −0 packages/compiler/src/utils/misc.ts
+61 −0 packages/compiler/test/experimental/mutator.test.ts
+66 −8 ...harp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ModelReaderWriterContextDefinition.cs
+8 −0 ...t-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/MrwSerializationTypeDefinition.cs
+158 −6 ...rosoft.TypeSpec.Generator.ClientModel/test/Providers/Definitions/ModelReaderWriterContextDefinitionTests.cs
+10 −0 ...ReaderWriterContextDefinitionTests/ValidateCustomPropertiesOnModelsAreDiscovered/ModelWithCustomProperty.cs
+6 −2 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/test/TestHelpers/MockHelpers.cs
+4 −5 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/ModelProvider.cs
+19 −12 packages/http-client-csharp/generator/Microsoft.TypeSpec.Generator/src/Providers/TypeProvider.cs
+66 −0 ...tp-client-csharp/generator/Microsoft.TypeSpec.Generator/test/Providers/ModelProviders/ModelProviderTests.cs
+1 −1 ...viders/TestData/ModelCustomizationTests/CanCustomizeAccessibilityWithCustomizedNamespace/CustomizedModel.cs
+8 −0 ...oviders/TestData/ModelProviderTests/BackCompat_NonAbstractTypeIsRespected_NameChangedInVisitor/BaseModel.cs
+8 −0 ...rs/TestData/ModelProviderTests/BackCompat_NonAbstractTypeIsRespected_NamespaceChangedInVisitor/BaseModel.cs
+8 −0 ...s/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Models/Pet.Serialization.cs
+2 −8 packages/http-client-java/emitter/src/code-model-builder.ts
+0 −6 packages/http-client-java/emitter/src/lib.ts
+8 −0 packages/http-client-java/generator/README.md
+19 −0 ...ain/java/com/microsoft/typespec/http/client/generator/core/implementation/ClientModelPropertiesManager.java
+8 −1 ...rator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java
+15 −0 ...c/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ConvertToJsonTypeTrait.java
+6 −1 ...erator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/EnumType.java
+10 −1 ...r-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/PrimitiveType.java
+96 −64 ...-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ModelTemplate.java
+46 −16 .../main/java/com/microsoft/typespec/http/client/generator/core/template/StreamSerializationModelTemplate.java
+1 −35 ...nt-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java
+0 −1 ...generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/SawShark.java
+115 −0 ...tp-client-java/generator/http-client-generator-test/src/main/java/tsptest/subclass/SubclassAsyncClient.java
+113 −0 ...es/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/subclass/SubclassClient.java
+287 −0 ...-client-java/generator/http-client-generator-test/src/main/java/tsptest/subclass/SubclassClientBuilder.java
+107 −0 .../generator/http-client-generator-test/src/main/java/tsptest/subclass/implementation/SubclassClientImpl.java
+193 −0 ...t-java/generator/http-client-generator-test/src/main/java/tsptest/subclass/implementation/SubclassImpl.java
+10 −0 ...t-java/generator/http-client-generator-test/src/main/java/tsptest/subclass/implementation/package-info.java
+154 −0 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/subclass/models/Body.java
+88 −0 ...a/generator/http-client-generator-test/src/main/java/tsptest/subclass/models/DuplicateRequiredProperty.java
+105 −0 ...rator/http-client-generator-test/src/main/java/tsptest/subclass/models/DuplicateRequiredPropertyParent.java
+77 −0 ...a/generator/http-client-generator-test/src/main/java/tsptest/subclass/models/PropertyChangedToConstant.java
+83 −0 ...rator/http-client-generator-test/src/main/java/tsptest/subclass/models/PropertyChangedToConstantParent.java
+82 −0 ...a/generator/http-client-generator-test/src/main/java/tsptest/subclass/models/PropertyChangedToRequired.java
+93 −0 ...rator/http-client-generator-test/src/main/java/tsptest/subclass/models/PropertyChangedToRequiredParent.java
+10 −0 ...tp-client-java/generator/http-client-generator-test/src/main/java/tsptest/subclass/models/package-info.java
+10 −0 ...ages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/subclass/package-info.java
+19 −0 ...a/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-subclass_apiview_properties.json
+1 −0 ...client-java/generator/http-client-generator-test/src/main/resources/META-INF/tsptest-subclass_metadata.json
+2 −0 packages/http-client-java/generator/http-client-generator-test/src/main/resources/tsptest-subclass.properties
+33 −0 ...-client-java/generator/http-client-generator-test/src/test/java/tsptest/subclass/SubclassPropertyTests.java
+34 −0 ...a/generator/http-client-generator-test/src/test/java/tsptest/subclass/generated/SubclassClientTestBase.java
+58 −0 packages/http-client-java/generator/http-client-generator-test/tsp/subclass.tsp
+3 −3 packages/http-client-python/eng/scripts/ci/dev_requirements.txt
+1 −1 packages/http-client-python/eng/scripts/ci/pylintrc
+2 −2 packages/http-client-python/generator/pygen/codegen/models/response.py
+4 −3 packages/http-client-python/generator/pygen/codegen/templates/model_base.py.jinja2
+49 −0 packages/openapi3/test/versioning.test.ts
+2 −0 packages/typespec-vscode/src/const.ts
+122 −0 packages/typespec-vscode/src/lm/language-model.ts
+14 −0 packages/typespec-vscode/src/tsp-language-client.ts
+10 −0 packages/typespec-vscode/src/types.ts
+68 −1 packages/typespec-vscode/src/utils.ts
6 changes: 6 additions & 0 deletions typespec-extension/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 0.38.1 (2026-01-12)

Compatible with compiler 1.7.1.

- Updated package dependencies to latest versions.

## 0.38.0 (2026-01-08)

Compatible with compiler 1.7.1.
Expand Down
392 changes: 211 additions & 181 deletions typespec-extension/package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions typespec-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@azure-tools/typespec-java",
"version": "0.38.0",
"version": "0.38.1",
"description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding",
"keywords": [
"TypeSpec"
Expand Down Expand Up @@ -74,8 +74,8 @@
"@azure-tools/typespec-liftr-base": "0.11.0",
"@microsoft/api-extractor": "^7.55.2",
"@types/js-yaml": "~4.0.9",
"@types/lodash": "~4.17.21",
"@types/node": "~25.0.3",
"@types/lodash": "~4.17.23",
"@types/node": "~25.0.6",
"@typescript-eslint/eslint-plugin": "~8.52.0",
"@typescript-eslint/parser": "~8.52.0",
"@typespec/compiler": "1.7.1",
Expand All @@ -88,8 +88,8 @@
"@typespec/tspd": "0.73.2",
"@typespec/versioning": "0.77.0",
"@typespec/xml": "0.77.0",
"@vitest/coverage-v8": "^4.0.16",
"@vitest/ui": "^4.0.16",
"@vitest/coverage-v8": "^4.0.17",
"@vitest/ui": "^4.0.17",
"c8": "~10.1.3",
"eslint": "~9.39.2",
"eslint-plugin-deprecation": "~3.0.0",
Expand All @@ -99,7 +99,7 @@
"rimraf": "~6.1.2",
"typescript": "~5.9.3",
"typescript-eslint": "^8.52.0",
"vitest": "^4.0.16"
"vitest": "^4.0.17"
},
"overrides": {
"eslint": "~9.39.2",
Expand Down
2 changes: 1 addition & 1 deletion typespec-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@typespec/spector": "0.1.0-alpha.21",
"@typespec/http-specs": "0.1.0-alpha.29",
"@azure-tools/azure-http-specs": "0.1.0-alpha.34",
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.38.0.tgz"
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.38.1.tgz"
},
"devDependencies": {
"@typespec/prettier-plugin-typespec": "^1.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ public void validate() {
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("kind", this.kind);
jsonWriter.writeIntField("age", age());
jsonWriter.writeJsonField("properties", innerProperties());
jsonWriter.writeJsonField("anotherProperties", innerAnotherProperties());
jsonWriter.writeStringField("dna", this.dna);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package tsptest.subclass;

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
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.util.BinaryData;
import com.azure.core.util.FluxUtil;
import reactor.core.publisher.Mono;
import tsptest.subclass.implementation.SubclassImpl;
import tsptest.subclass.models.Body;

/**
* Initializes a new instance of the asynchronous SubclassClient type.
*/
@ServiceClient(builder = SubclassClientBuilder.class, isAsync = true)
public final class SubclassAsyncClient {
@Generated
private final SubclassImpl serviceClient;

/**
* Initializes an instance of SubclassAsyncClient class.
*
* @param serviceClient the service client implementation.
*/
@Generated
SubclassAsyncClient(SubclassImpl serviceClient) {
this.serviceClient = serviceClient;
}

/**
* The propertyInSubclass operation.
* <p><strong>Request Body Schema</strong></p>
*
* <pre>
* {@code
* {
* duplicateRequiredProperty (Optional): {
* property: String (Required)
* duplicateRequiredProperty: String (Required)
* }
* propertyChangedToRequired (Optional): {
* propertyChangedToRequired: String (Required)
* }
* propertyChangedToConstant (Optional): {
* propertyChangedToConstant: String (Required)
* }
* }
* }
* </pre>
*
* <p><strong>Response Body Schema</strong></p>
*
* <pre>
* {@code
* {
* duplicateRequiredProperty (Optional): {
* property: String (Required)
* duplicateRequiredProperty: String (Required)
* }
* propertyChangedToRequired (Optional): {
* propertyChangedToRequired: String (Required)
* }
* propertyChangedToConstant (Optional): {
* propertyChangedToConstant: String (Required)
* }
* }
* }
* </pre>
*
* @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 the response body along with {@link Response} on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<BinaryData>> propertyInSubclassWithResponse(BinaryData body, RequestOptions requestOptions) {
return this.serviceClient.propertyInSubclassWithResponseAsync(body, requestOptions);
}

/**
* The propertyInSubclass operation.
*
* @param body The body parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @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.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response body on successful completion of {@link Mono}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Body> propertyInSubclass(Body body) {
// Generated convenience method for propertyInSubclassWithResponse
RequestOptions requestOptions = new RequestOptions();
return propertyInSubclassWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(Body.class));
}
}
113 changes: 113 additions & 0 deletions typespec-tests/src/main/java/tsptest/subclass/SubclassClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) TypeSpec Code Generator.

package tsptest.subclass;

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
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.util.BinaryData;
import tsptest.subclass.implementation.SubclassImpl;
import tsptest.subclass.models.Body;

/**
* Initializes a new instance of the synchronous SubclassClient type.
*/
@ServiceClient(builder = SubclassClientBuilder.class)
public final class SubclassClient {
@Generated
private final SubclassImpl serviceClient;

/**
* Initializes an instance of SubclassClient class.
*
* @param serviceClient the service client implementation.
*/
@Generated
SubclassClient(SubclassImpl serviceClient) {
this.serviceClient = serviceClient;
}

/**
* The propertyInSubclass operation.
* <p><strong>Request Body Schema</strong></p>
*
* <pre>
* {@code
* {
* duplicateRequiredProperty (Optional): {
* property: String (Required)
* duplicateRequiredProperty: String (Required)
* }
* propertyChangedToRequired (Optional): {
* propertyChangedToRequired: String (Required)
* }
* propertyChangedToConstant (Optional): {
* propertyChangedToConstant: String (Required)
* }
* }
* }
* </pre>
*
* <p><strong>Response Body Schema</strong></p>
*
* <pre>
* {@code
* {
* duplicateRequiredProperty (Optional): {
* property: String (Required)
* duplicateRequiredProperty: String (Required)
* }
* propertyChangedToRequired (Optional): {
* propertyChangedToRequired: String (Required)
* }
* propertyChangedToConstant (Optional): {
* propertyChangedToConstant: String (Required)
* }
* }
* }
* </pre>
*
* @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 the response body along with {@link Response}.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<BinaryData> propertyInSubclassWithResponse(BinaryData body, RequestOptions requestOptions) {
return this.serviceClient.propertyInSubclassWithResponse(body, requestOptions);
}

/**
* The propertyInSubclass operation.
*
* @param body The body parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @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.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response.
*/
@Generated
@ServiceMethod(returns = ReturnType.SINGLE)
public Body propertyInSubclass(Body body) {
// Generated convenience method for propertyInSubclassWithResponse
RequestOptions requestOptions = new RequestOptions();
return propertyInSubclassWithResponse(BinaryData.fromObject(body), requestOptions).getValue()
.toObject(Body.class);
}
}
Loading