Skip to content

Commit

Permalink
build(deps): bump tsp 0.61.2 (#4693)
Browse files Browse the repository at this point in the history
- bump tsp 0.61.2 and corresponding libraries
- update according to API change

part of Azure/autorest.csharp#5111

---------

Co-authored-by: Mingzhe Huang (from Dev Box) <mingzhehuang@microsoft.com>
  • Loading branch information
archerzz and Mingzhe Huang (from Dev Box) authored Oct 17, 2024
1 parent 64f1dba commit 0b92467
Show file tree
Hide file tree
Showing 34 changed files with 673 additions and 516 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
SdkType,
UsageFlags,
} from "@azure-tools/typespec-client-generator-core";
import { getDoc } from "@typespec/compiler";
import { NetEmitterOptions, resolveOptions } from "../options.js";
import { CodeModel } from "../type/code-model.js";
import { InputClient } from "../type/input-client.js";
Expand Down Expand Up @@ -86,7 +85,7 @@ export function createModel(sdkContext: SdkContext<NetEmitterOptions>): CodeMode
const clientParameters = fromSdkEndpointParameter(endpointParameter);
return {
Name: getClientName(client, parentNames),
Description: client.description,
Description: client.summary ?? client.doc,
Operations: client.methods
.filter((m) => m.kind !== "clientaccessor")
.map((m) =>
Expand Down Expand Up @@ -158,8 +157,7 @@ export function createModel(sdkContext: SdkContext<NetEmitterOptions>): CodeMode
parameters.push({
Name: parameter.name,
NameInRequest: parameter.serializedName,
// TODO: remove this workaround after https://github.com/Azure/typespec-azure/issues/1212 is fixed
Description: parameter.__raw ? getDoc(sdkContext.program, parameter.__raw) : undefined,
Description: parameter.doc,
// TODO: we should do the magic in generator
Type: parameterType,
Location: RequestLocation.Uri,
Expand Down
8 changes: 4 additions & 4 deletions packages/http-client-csharp/emitter/src/lib/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function fromSdkModelType(
) /* when tcgc provide a way to identify if the access is override or not, we can get the accessibility from the modelType.access */,
usage: modelType.usage,
deprecation: modelType.deprecation,
description: modelType.description,
description: modelType.summary ?? modelType.doc,
discriminatorValue: modelType.discriminatorValue,
decorators: modelType.decorators,
} as InputModelType;
Expand Down Expand Up @@ -185,7 +185,7 @@ export function fromSdkModelType(
kind: property.kind,
name: property.name,
serializedName: serializedName,
description: property.description,
description: property.summary ?? property.doc,
type: fromSdkType(
targetType,
context,
Expand Down Expand Up @@ -225,7 +225,7 @@ export function fromSdkEnumType(
enumType.__raw as any,
) /* when tcgc provide a way to identify if the access is override or not, we can get the accessibility from the enumType.access,*/,
deprecation: enumType.deprecation,
description: enumType.description,
description: enumType.summary ?? enumType.doc,
isFixed: enumType.isFixed,
isFlags: enumType.isFlags,
usage: enumType.usage,
Expand Down Expand Up @@ -386,7 +386,7 @@ function fromSdkEnumValueType(
value: enumValueType.value,
valueType: fromSdkBuiltInType(enumValueType.valueType),
enumType: fromSdkEnumType(enumValueType.enumType, context, typeMap),
description: enumValueType.description,
description: enumValueType.summary ?? enumValueType.doc,
decorators: enumValueType.decorators,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
shouldGenerateConvenient,
shouldGenerateProtocol,
} from "@azure-tools/typespec-client-generator-core";
import { getDeprecated, getDoc, getSummary, isErrorModel } from "@typespec/compiler";
import { getDeprecated, isErrorModel } from "@typespec/compiler";
import { HttpStatusCodeRange } from "@typespec/http";
import { getResourceOperation } from "@typespec/rest";
import { NetEmitterOptions } from "../options.js";
Expand Down Expand Up @@ -76,10 +76,8 @@ export function fromSdkServiceMethod(
.name ??
getOperationGroupName(sdkContext, method.operation, sdkContext.sdkPackage.rootNamespace),
Deprecated: getDeprecated(sdkContext.program, method.__raw!),
// TODO: we need to figure out how we want to handle summary and description
// Right now, we generate garbage <remarks> for some APIs like `Platform-OpenAI-TypeSpec`
Summary: getSummary(sdkContext.program, method.__raw!),
Description: getDoc(sdkContext.program, method.__raw!),
Summary: method.summary,
Description: method.doc,
Accessibility: method.access,
Parameters: [...clientParameters, ...parameterMap.values()],
Responses: [...responseMap.values()],
Expand Down Expand Up @@ -185,7 +183,7 @@ function fromSdkHttpOperationParameter(
return {
Name: p.name,
NameInRequest: p.kind === "header" ? normalizeHeaderName(serializedName) : serializedName,
Description: p.description,
Description: p.summary ?? p.doc,
Type: parameterType,
Location: getParameterLocation(p),
IsApiVersion:
Expand Down Expand Up @@ -273,7 +271,7 @@ function fromSdkServiceResponseHeaders(
({
Name: h.__raw!.name,
NameInResponse: h.serializedName,
Description: h.description,
Description: h.summary ?? h.doc,
Type: fromSdkType(h.type, sdkContext, typeMap),
}) as HttpResponseHeader,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"$id": "7",
"Name": "endpoint",
"NameInRequest": "endpoint",
"Description": "Service host",
"Type": {
"$id": "8",
"kind": "url",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"$id": "7",
"Name": "endpoint",
"NameInRequest": "endpoint",
"Description": "Service host",
"Type": {
"$id": "8",
"kind": "url",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"$id": "7",
"Name": "endpoint",
"NameInRequest": "endpoint",
"Description": "Service host",
"Type": {
"$id": "8",
"kind": "url",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"$id": "4",
"Name": "endpoint",
"NameInRequest": "endpoint",
"Description": "Service host",
"Type": {
"$id": "5",
"kind": "url",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@
"$id": "29",
"Name": "endpoint",
"NameInRequest": "endpoint",
"Description": "Service host",
"Type": {
"$id": "30",
"kind": "url",
Expand Down Expand Up @@ -719,6 +720,7 @@
"$id": "67",
"Name": "endpoint",
"NameInRequest": "endpoint",
"Description": "Service host",
"Type": {
"$id": "68",
"kind": "url",
Expand Down Expand Up @@ -920,6 +922,7 @@
"$id": "85",
"Name": "endpoint",
"NameInRequest": "endpoint",
"Description": "Service host",
"Type": {
"$id": "86",
"kind": "url",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public enum ClientType
/// <summary> RenamedOperation. </summary>
RenamedOperation,
/// <summary> TwoOperationGroup. </summary>
TwoOperationGroup
TwoOperationGroup,
/// <summary> ClientOperationGroup. </summary>
ClientOperationGroup
}
}
Loading

0 comments on commit 0b92467

Please sign in to comment.