microsoft / microsoft/typespec
[Bug]: http-client-java, unbranded, response as wired type Base64, Base64Uri
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
### Describe the bug
azure supports this in RestProxy as
```
@ReturnValueWireType(Base64Url.class)
Mono>> getBase64Url(@HostParam("$host") String host, @HeaderParam("Accept") String accept,
Context context);
```
`@ReturnValueWireType` would handle the de-serialization.
---
In clientcore, `Base64Uri` would work after we add `returnValueWireType = Base64Uri.class`.
However, `byte[]` with Base64 encode is not handled.
### Reproduction
http-specs test
### Checklist
- [x] Follow our [Code of Conduct](https://github.com/microsoft/typespec/blob/main/CODE_OF_CONDUCT.md)
- [x] Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/Microsoft/typespec/discussions).
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
Contributor guide
Research direction
Start with the http-specs test and compare its behavior with the RestProxy example using @ReturnValueWireType. Read the clientcore Base64Uri handling, then trace how a byte[] response with Base64 encoding is deserialized. Done means the reproduction test passes for both Base64Uri and Base64 responses.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100