You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is found when we compared the gaps between HLC and mdoular. In Azure mgmt SDK, some services define subscriptionId as client level(see example) and others define as method level(see example). The x-ms-parameter-location could differentiate the location(def here).
In modular we need to support them both. Currently typespec can't express client-level parameter except ones in parameterized host. But TCGC is planning to support this(see issue).
Here is the proposal on how to support client-level subscriptionId.
RLC
In RLC we will keep REST-style so subscriptionId will be taken as method parameter because it is path-level parameter.
exportinterfaceRoutes{/** Resource for '/providers/Microsoft.NetworkAnalytics/operations' has methods for the following verbs: get */(path: "/providers/Microsoft.NetworkAnalytics/operations"): OperationsList;/** Resource for '/subscriptions/\{subscriptionId\}/resourceGroups/\{resourceGroupName\}/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default' has methods for the following verbs: get */(path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkAnalytics/dataProductsCatalogs/default",subscriptionId: string,resourceGroupName: string,): DataProductsCatalogsGet;// ....}
Considering the design of client-level parameter in TCGC is not finalized, currently our generation would cause a lot of un-necessary breakings between HLC and modular. So I prefer we could enable the subscriptionId as client level param for ARM in compatibilityMode.
For long term we would trust what the customers defined in client.tsp.
The text was updated successfully, but these errors were encountered:
MaryGao
changed the title
The param subscriptionId is not prompted to client level for cross all operations' one
The param subscriptionId is not prompted to client level for cross all operations
Mar 13, 2024
MaryGao
changed the title
The param subscriptionId is not prompted to client level for cross all operations
Revisit client level parameters for cross all operations
May 21, 2024
MaryGao
changed the title
Revisit client level parameters for cross all operations
Revisit client level parameters cross all operations
May 21, 2024
Background
This is found when we compared the gaps between HLC and mdoular. In Azure mgmt SDK, some services define
subscriptionId
as client level(see example) and others define as method level(see example). Thex-ms-parameter-location
could differentiate the location(def here).In modular we need to support them both. Currently typespec can't express client-level parameter except ones in parameterized host. But TCGC is planning to support this(see issue).
Spec here
Proposal
Here is the proposal on how to support client-level
subscriptionId
.In RLC we will keep REST-style so
subscriptionId
will be taken as method parameter because it is path-level parameter.Example code
Similar to RLC the subId would be in method level also. Generated code:
Example code
For client-level
subscriptionId
it will be in client constructor.Example code would be like:
Short-term solution
Considering the design of client-level parameter in TCGC is not finalized, currently our generation would cause a lot of un-necessary breakings between HLC and modular. So I prefer we could enable the subscriptionId as client level param for ARM in
compatibilityMode
.For long term we would trust what the customers defined in client.tsp.
The text was updated successfully, but these errors were encountered: