[test] clientcore, test for RestProxy with types #44319
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The handling of types in request and response is kind of ad-hoc.
For request parameter, there is a list of types
azure-sdk-for-java/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/http/rest/SwaggerMethodParser.java
Lines 617 to 637 in 263eb51
But for type that not in the list, the
else
block generally does not work correctly. See #44287For response, it generally won't work if the type does not have a
JsonSerializable
. But for Java class likeOffsetDateTime
orDuration
orbyte[]
, they don't have it. -- This also happens when they are in a List e.g.List<Duration>
.The only one that works without
JsonSerializable
isBase64Uri
as there is a special handling ofreturnValueWireType
azure-sdk-for-java/sdk/clientcore/core/src/main/java/io/clientcore/core/implementation/http/rest/RestProxyImpl.java
Lines 428 to 430 in 263eb51
Also,
text/plain
does not work (it works for Azure core). Do we need aTextSerializer
?canProcessEnum
can pass, if we addJsonSerializable
to enum.Description
Please add an informative description that covers that changes made by the pull request and link all relevant issues.
If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines