Generated createClient method does not use all parameters for parameterized host
See original GitHub issueWhen using a parameterized host with multiple parts, the TS autorest client will only include parameters in the createClient method for one of the parts.
This impacts the PR and linked spec here.
Our parameterized host looks like the following:
“{tenantId}-{resourceName}.{dnsSuffix}”.
The expected createClient method would looks like the following:
export default function createClient(
tenantId: string,
devCenter: string,
credentials: TokenCredential,
devCenterDnsSuffix: string = "devcenter.azure.com",
options: ClientOptions = {}
): AzureDevCenterClient {
const baseUrl = options.baseUrl ?? `https://${tenantId}-${devCenter}.${devCenterDnsSuffix}`;
The actual method is as follows:
export default function createClient(
tenantId: string,
credentials: TokenCredential,
options: ClientOptions = {}
): AzureDevCenterClient {
const baseUrl = options.baseUrl ?? `https://${tenantId}-{devCenter}.{devCenterDnsSuffix}`;
autorest.typescript version is 6.0.0-rc.1
This generates an unusable createClient method, blocking use of the package. Happy to help investigate or provide more info as needed!
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
RedisClientType hard to use with createClient #1865
The RedisClientType has two generic parameters that make it hard to use to signify the return type of createClient .
Read more >Make HTTP requests using IHttpClientFactory in ASP.NET ...
A new instance of HttpClient is created. The configuration action is called. To create a named client, pass its name into CreateClient :...
Read more >How Setup Parameters for AddHttpClient when ...
I'm try setting up a IHttpClientFactory , and i'd like to know how to send it parameters when it is created, those parameters...
Read more >RequestsLibrary - MarketSquare
The quickest way to start is using the requests keywords and urls see below examples: ... If the response body does not contain...
Read more >Content Delivery API
Contentful defines the sys.id property for every resource that is not a ... You can use the order parameter when paging through larger...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@MaryGao rc.2 fixes this issue for us, thank you so much! We are noticing a second issue withe the parameterized host in createClient though – we have a default value for one of the host parameters, and the default value is not provided. We have manually fixed this for our PR, let me know if there is a fix we can consume instead though!
So rather than the expected output, we get:
Link to the spec doc: https://github.com/Azure/azure-rest-api-specs/blob/75a8d8dcc9f6d0ec626bdeb32f5154f20c8c61cd/specification/devcenter/data-plane/Microsoft.DevCenter/preview/2022-03-01-preview/devcenter.json
Close this issue considering the issue resolved. Feel free to reopen it if necessary!