An AsyncAPI Golang Code generator that generates all Go code from the broker to the application/user. Just plug your application to your favorite message broker!
Apache License 2.0
91
stars
23
forks
source link
[bug] Typed headers can't be parsed from message #241
Generating code for the above results in following code:
// Get each headers from broker message
for k, v := range bMsg.Headers {
switch {
case k == "event_id": // Retrieving EventId header
msg.Headers.EventId = (v)
default:
// TODO: log unknown error
}
}
where msg.Headers.EventId is of type EventIdSchema but we are trying to assign []byte to it.
When using
$ref
in headers the headers can't be parsed from the message as they are not typed back to specific type properly. Minimal example:Generating code for the above results in following code:
where
msg.Headers.EventId
is of typeEventIdSchema
but we are trying to assign[]byte
to it.