Skip to content
Closed
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 56 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
+8 −0 ...s/http-client-csharp/generator/TestProjects/Local/Sample-TypeSpec/src/Generated/Models/Pet.Serialization.cs
+8 −0 packages/http-client-java/generator/README.md
+19 −0 ...ain/java/com/microsoft/typespec/http/client/generator/core/implementation/ClientModelPropertiesManager.java
+96 −64 ...-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ModelTemplate.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
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