-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client name and encoded name support #2297
Client name and encoded name support #2297
Conversation
* add test * update test
…om/qiaozha/autorest.typescript into clientName-and-encodedName-support
@@ -22,3 +22,6 @@ export interface ListItemInputBody { | |||
/** The name of the input. */ | |||
inputName: string; | |||
} | |||
|
|||
/** Alias for ListItemInputExtensibleEnum */ | |||
export type ListItemInputExtensibleEnum = string | "First" | "Second"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is because cadl-ranch has changed extensible enum into union, I think we could support it better when we finish the extensible enum review.
packages/typespec-ts/test/modularIntegration/clientNaming.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. Overall LGTM. pls ensure the RLC header case is correct. If the modular client name is not supported i prefer not adding cases.
packages/typespec-ts/test/modularIntegration/generated/client/naming/src/api/operations.ts
Outdated
Show resolved
Hide resolved
packages/typespec-ts/test/modularIntegration/generated/client/naming/src/api/operations.ts
Outdated
Show resolved
Hide resolved
I still have concerns for modular cases and could you take a look?
* update modular test case * remove console.log * add assert about the header in the response * update modular test case * Update packages/typespec-ts/test/integration/clientNaming.spec.ts --------- Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>
it("should work with header response", async () => { | ||
try { | ||
const result = await client.response({ | ||
onResponse: function (res) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joheredi I remember you mentioned we should avoid onResponse
option in modular? Am I correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for this pr but seems ci failed.
LoadTestRunClient, | ||
LoadTestRunClientOptions, | ||
} from "./loadTestRun/LoadTestRunClient.js"; | ||
TestRunOperationsClient, | ||
TestRunOperationsClientOptions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is correct as client.tsp defined.
errorDetails: !result.body["errorDetails"] | ||
? result.body["errorDetails"] | ||
: result.body["errorDetails"].map((p) => ({ message: p["message"] })), | ||
errorDetails: | ||
result.body["errorDetails"] === undefined | ||
? result.body["errorDetails"] | ||
: result.body["errorDetails"].map((p) => ({ message: p["message"] })), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is to work around typescript compiler bug of optional chain, see from playground link
@@ -1532,7 +1532,7 @@ export type DynamicVNetAssignmentScope = string; | |||
/** The endpoint configuration for a Pool. */ | |||
export interface PoolEndpointConfiguration { | |||
/** A list of inbound NAT Pools that can be used to address specific ports on an individual Compute Node externally. The maximum number of inbound NAT Pools per Batch Pool is 5. If the maximum number of inbound NAT Pools is exceeded the request fails with HTTP status code 400. This cannot be specified if the IPAddressProvisioningType is NoPublicIPAddresses. */ | |||
inboundNATPools: InboundNATPool[]; | |||
inboundNatPools: InboundNATPool[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is because there are projectedName client in the typespec.
fixes #2259