Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

JSON deserializable string assumed without dataType #17

Closed
maiqbal11 opened this issue Sep 3, 2019 · 1 comment
Closed

JSON deserializable string assumed without dataType #17

maiqbal11 opened this issue Sep 3, 2019 · 1 comment

Comments

@maiqbal11
Copy link
Contributor

Repro steps:

  1. Create a JavaScript EventHub triggered function from the default template
  2. Write a plain string (e.g. "a") to the EventHub. Results in the following failure:
[9/3/2019 8:03:15 PM] System.Private.CoreLib: Exception while executing function: Functions.EventHubTrigger. Microsoft.Azure.WebJobs.Host: Exception binding parameter 'eventHubMessages'. Microsoft.Azure.WebJobs.Host: Binding parameters to complex objects (such as 'Object
') uses Json.NET serialization.
1. Bind the parameter type as 'string' instead of 'Object' to get the raw values and avoid JSON deserialization, or
2. Change the queue payload to be valid json. The JSON parser failed: Unexpected character encountered while parsing value: a. Path '', line 0, position 0.

Issue does not happen if we write a JSON (e.g. { "b" : "a" } to the EventHub or specify dataType as string in the function.json.

Default behavior should be just to have the string without any deserialization?

@alrod
Copy link
Member

alrod commented Feb 4, 2022

This is expected behavior.

@alrod alrod closed this as completed Feb 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants