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
Notice that there are some keys in the Metadata map (e.g. ContentType, EnqueuedTimeUtc, LockToken, etc.) that have their values wrapped in double quotes (""). Note I've seen the trigger input (in this case queue) behave the same way (wrapped in double quotes) but have gotten around this by setting "dataType" to "binary" in the function.json file.
This is causing issues when I try and unmarshal this metadata map into a Golang struct where EnqueuedTimeUtc is of type time.Time:
type ServiceBusMessageMetadata struct {
DeliveryCount int `json:"DeliveryCount,string"`
EnqueuedTimeUtc time.Time `json:"EnqueuedTimeUtc"`
ExpiresAtUtc string `json:"ExpiresAtUtc"`
LockToken string `json:"LockToken"`
MessageID string `json:"MessageId"`
}
My code is producing an error like the following when trying to unmarshal this:
failed to unmarshal servicebus metadata to ServiceBusMessageMetadata struct: parsing time ""\"2020-08-31T16:49:41.831Z\""" as ""2006-01-02T15:04:05Z07:00"": cannot parse "\"2020-08-31T16:49:41.831Z\""" as "2006"
pragnagopa
changed the title
[Custom Handlers - Go] Extra double quotes appearing in ServiceBus input
[Custom Handlers][ServiceBusTrigger]Metadata for type Date type is serialized as string
Sep 28, 2020
pragnagopa
changed the title
[Custom Handlers][ServiceBusTrigger]Metadata for type Date type is serialized as string
[Custom Handlers][ServiceBusTrigger]Metadata of Date type is serialized as string
Sep 28, 2020
pragnagopa
changed the title
[Custom Handlers][ServiceBusTrigger]Metadata of Date type is serialized as string
[Custom Handlers]Metadata of Date type is serialized as string
Sep 28, 2020
pragnagopa
changed the title
[Custom Handlers]Metadata of Date type is serialized as string
[Custom Handlers]Metadata of DateTime type is serialized as string
Sep 28, 2020
When creating a function with a ServiceBus input and logging the InvokeRequest, I am seeing something like the following in App Insights:
Notice that there are some keys in the Metadata map (e.g. ContentType, EnqueuedTimeUtc, LockToken, etc.) that have their values wrapped in double quotes (""). Note I've seen the trigger input (in this case
queue
) behave the same way (wrapped in double quotes) but have gotten around this by setting"dataType"
to"binary"
in thefunction.json
file.This is causing issues when I try and unmarshal this metadata map into a Golang struct where
EnqueuedTimeUtc
is of typetime.Time
:My code is producing an error like the following when trying to unmarshal this:
I can validate this by running the following:
which produces:
Notice that ContentType is surrounded in double quotes, exactly like how the
InvokeRequest
struct being handed to my function is.Investigative information
Please provide the following:
The text was updated successfully, but these errors were encountered: