You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where using the flag --force-pointers , with headers that are required, the generated code will be invalid.
Example yaml:
asyncapi: 2.6.0info:
title: Sample Appversion: 1.2.3components:
messages:
Test:
headers:
type: objectrequired:
- correlationIdproperties:
correlationId:
description: Correlation ID set by usertype: stringpayload:
type: string
Generates:
// brokerMessageToTestMessageswitch {
casek=="correlationId": // Retrieving CorrelationId headermsg.Headers.CorrelationId=string(v) // <-- v is a pointer here, so it won't workdefault:
}
...// toBrokerMessageheaders["correlationId"] = []byte(msg.Headers.CorrelationId) // <-- msg.Headers.CorrelationId is a pointer here, so it won't work
This only happens if the following conditions are present:
Flag --force-pointers is used
Headers are presents
Headers are required
I'll see if this can be fixed easily.
Thanks,
TheSadlig
The text was updated successfully, but these errors were encountered:
Hi there,
Where using the flag
--force-pointers
, with headers that are required, the generated code will be invalid.Example yaml:
Generates:
This only happens if the following conditions are present:
--force-pointers
is usedI'll see if this can be fixed easily.
Thanks,
TheSadlig
The text was updated successfully, but these errors were encountered: