Allow setting headers from Serializer
See original GitHub issueExisting API (which I suppose was modeled after java API) have immutable Headers
as an argument to serialize
:
def serialize(topic: String, headers: Headers, a: A): F[Array[Byte]]
Immutability of Headers
makes it impossible to set headers when deserializing a message.
Probably, Headers
should be moved to return position of serialize
:
def serialize(topic: String, a: A): F[(Array[Byte], Headers)]
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Adding encode header for REST framework - Stack Overflow
Django REST Framework Response() you can pass headers as argument class SmartTagViewSet(viewsets.
Read more >class based views, response headers and CORS
Ideally I would need to set the headers to something like ["Access-Control-Allow-Origin"] = "*" but am unsure how to do this using these...
Read more >Serializers - Django REST framework - Tom Christie
Serializers allow complex data such as querysets and model instances to be converted to native Python datatypes that can then be easily rendered...
Read more >Content negotiation and serialization | Ktor
For this, it uses the Accept and Content-Type headers. ... need to add the Kotlin serialization plugin as described in the Setup section....
Read more >Reply - Fastify
.removeHeader(key) - Remove the value of a previously set header. ... default JSON serializer or using the custom serializer (if one is set)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t believe the java serialiser allows to set headers. Does it?
If the problem is just that the output of
Headers#toJava
is immutable, I think the following should work - it converts the headers to the Java class using a constructor that makes a (shallow) defensive copy.Does this look like it will solve the issue? If so I’m happy to incorporate it into the library, but could you first try it out and let me know how it goes?