Skip to content

Execute function adds extra quotes to body in new Node.js model #3515

Open

Description

Repro steps

  1. Create a node.js project with the new programming model
  2. Add an http function
  3. Run the project
  4. List the functions in workspace view (with Nathan's fix Node v4 model should list local functions #3513)
  5. Execute the http function with body Eric or empty body (Just not { "name": "Eric" } which is how we did it in the old model)

Expected

Response should be Hello, Eric! or Hello, World!

Actual

Response is Hello, "Eric"! or Hello, ""!

More info

I think this is actually related to #3003 cc @motm32. I did some digging and turns out sendRequestWithExtTimeout will automatically JSON serialize the body unless you set disableJsonStringifyOnBody to true. And if you JSON serialize a string, it apparently just adds quotes for some reason. I believe this extra JSON serialization is the root of all problems and I hope if you add disableJsonStringifyOnBody you can greatly simplify the serialization/parsing/etc. for http & service bus triggers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions