Support optional client-level parameter derived from x-ms-parameterized-host #1635
Labels
Client
This issue points to a problem in the data-plane of the library.
DPG/RLC v2.0 GA
DPG
Epic: Recreate API Contracts and SDKs
https://github.com/Azure/cadl-azure/issues/1948
LowLevelClient
Background
In recent RLC release we notice the requirement to handle optional client-level parameters in codegen.
In our current implementation we put these parameters in the signature of client factory. This could work fine for required parameter without default value. However if there exists default value we couldn't leverage it defined in swagger.
Current implementation
If we set the x-ms-parameterized-host as
and generated client constructor factory function look like this
Proposal
Option 1(preferred) - Put necessary parameter into XXXClientOption interface
Option 2 - Put the default value in method signature
We have two concerns
PS: To support apiVersion parameter we have dependency in autorest bug Azure/autorest#4656.
/cc @qiaozha @joheredi
The text was updated successfully, but these errors were encountered: