Skip to content
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

Merged
merged 38 commits into from
Mar 6, 2024

Conversation

qiaozha
Copy link
Member

@qiaozha qiaozha commented Feb 19, 2024

fixes #2259

@qiaozha qiaozha self-assigned this Feb 28, 2024
packages/typespec-ts/src/utils/modelUtils.ts Show resolved Hide resolved
packages/typespec-ts/src/utils/modelUtils.ts Show resolved Hide resolved
packages/typespec-ts/src/utils/modelUtils.ts Show resolved Hide resolved
@@ -22,3 +22,6 @@ export interface ListItemInputBody {
/** The name of the input. */
inputName: string;
}

/** Alias for ListItemInputExtensibleEnum */
export type ListItemInputExtensibleEnum = string | "First" | "Second";
Copy link
Member Author

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.

@qiaozha qiaozha marked this pull request as ready for review March 3, 2024 11:27
MaryGao
MaryGao previously approved these changes Mar 4, 2024
Copy link
Member

@MaryGao MaryGao left a 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.

@MaryGao MaryGao self-requested a review March 4, 2024 06:41
@MaryGao MaryGao dismissed their stale review March 4, 2024 06:42

I still have concerns for modular cases and could you take a look?

qiaozha and others added 2 commits March 4, 2024 15:54
* 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) {
Copy link
Member

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?

Copy link
Member

@MaryGao MaryGao left a 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.

Comment on lines -70 to +71
LoadTestRunClient,
LoadTestRunClientOptions,
} from "./loadTestRun/LoadTestRunClient.js";
TestRunOperationsClient,
TestRunOperationsClientOptions,
Copy link
Member Author

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.

Comment on lines -171 to +174
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"] })),
Copy link
Member Author

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[];
Copy link
Member Author

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.

@qiaozha qiaozha merged commit f06f22a into Azure:main Mar 6, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support @clientName and @encodedName
6 participants