Skip to content
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

Can't write a MessageBodyReader for the TBytes (or any other dynamic array) type #57

Open
fperana opened this issue Jul 16, 2024 · 0 comments

Comments

@fperana
Copy link
Contributor

fperana commented Jul 16, 2024

I need to write a custom MessageBodyReader (and MessageBodyWriter, this already works) to handle the TBytes type, such that this particular dynamic array type would be treated as a byte stream. This gives the ability to pass/return TBytes to/from a resource declared as consuming/producing a TMediaType.APPLICATION_OCTET_STREAM, without the need to create and having to deal with TMemoryStream (which seems to be the only currently/natively supported type when consuming/producing TMediaType.APPLICATION_OCTET_STREAM).

In reference to the following TODO:

// TODO: Modify, try first GetObjectFromParam (to rename!) and then GetSimpleParam

The current code actually inhibits the ability to write such a custom MessageBodyReader for the TBytes type, which is a dynamic array and these are treated by special code that doesn't use the MessageBodyReader registry. Solving this TODO would probably solve my issue (well, I tried and it actually solves it, but I can't foresee the drawbacks).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant