Closed danielszaniszlo closed 4 months ago
Hi @danielszaniszlo I made a change to use a more unique hardcoded name in this area of code generation. Once that is released updating to that version of Autorest / TypeSpec should resolve this problem. In the meantime, if possible, I'd just recommend editing this code manually after code generation to resolve the compilation problem.
Thanks Alan for the fix.
Hi @danielszaniszlo
Below is only a suggestion:
Azure SDK typically does not expose a listJobs(String nextToken)
with the continuation token. It is almost impossible for user to make that continuation token by themselves. The token is usually from a paged response of the List itself (which is included in this listJob
pageable API).
Therefore, usually SDK API would just be listJobs()
.
User would do e.g.
// process by page
listJobs().streamByPage().forEach(page -> {
// process each page as page.getValue()
});
// just fine a value in responses
listJobs().stream().findFirst(...);
or something like this, to consume the paged responses.
One may want to either not have this continuationToken
query param in Swagger, or use directive to remove this query param in swagger/readme.md
I have a generated method code that I need to modify due to a compilation error. The current method,
listJobs(String continuationToken)
, usescontinuationToken
as an input parameter, but the return value also includes acontinuationToken
. Is there a way to consistently change the input parameter tonextToken
?The generated method looks like this:
The expected output would be :
I tried using azure-autorest-customization, but it didn't help. There is no option to consistently "replace" a variable within the function. While I can rename the function and replace the input parameters of it, the variable within the method body remains unchanged. I can only update the entire body.