-
Notifications
You must be signed in to change notification settings - Fork 82
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
LLC Paging #1061
LLC Paging #1061
Conversation
javagen/src/main/java/com/azure/autorest/model/clientmodel/ClientMethod.java
Outdated
Show resolved
Hide resolved
Generated code misses parameters. Fixing. In the following code,
|
Fixed it by adding
|
Basic test can pass now👍
|
The issue is fixed👍 |
classBlock.privateMethod("List<BinaryData> getValues(BinaryData binaryData, String path)", block -> { | ||
block.line("Object obj = binaryData.toObject(Object.class);"); | ||
block.line("Object values = ((Map)obj).get(path);"); | ||
block.line("return (List<BinaryData>)(((List)values).stream().map(BinaryData::fromObject).collect(Collectors.toList()));"); | ||
}); | ||
classBlock.privateMethod("String getNextLink(BinaryData binaryData, String path)", block -> { | ||
block.line("Object obj = binaryData.toObject(Object.class);"); | ||
block.line("return (String)((Map)obj).getOrDefault(path, null);"); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need more code on check and protection on class type etc. in real code.
javagen/src/main/java/com/azure/autorest/template/ClientMethodTemplate.java
Show resolved
Hide resolved
javagen/src/main/java/com/azure/autorest/template/WrapperClientMethodTemplate.java
Show resolved
Hide resolved
protocol-tests/src/main/java/fixtures/paging/implementation/PagingsImpl.java
Show resolved
Hide resolved
* <p><strong>Response Body Schema</strong> | ||
* | ||
* <pre>{@code | ||
* BinaryData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The schema is probably not correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing.
Resolve #1034
Add paging support for low level client. Generated code example is in
protocol-tests.paging
.impl
is internal implementation. Users will useclient
class to access service. We have two kinds of clients, sync and async client. Each paging method in swagger will generate 4 methods.TODO