Azure / Azure/azure-functions-nodejs-library

Support changing dataType for a binding in v4

Open
#72 6 comments 3 reactions 0 assignees View on GitHub
model parity needs design P2
Dominant language
TypeScript
Stars
70
Forks
35
Avg merge
4d 18h
Merged PRs (30d)
6

Description

v3 function.json content:
```json
{
"name": "myQueueItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "helloworldqueue",
"connection": "storage_APPSETTING",
"dataType": "binary"
}
```

v3 index.js content:
```javascript
module.exports = async function (context, myQueueItem) {
context.log('JavaScript queue trigger function processed work item', myQueueItem);
};
```

In v3 the type of `myQueueItem` changes based on the value of `dataType`. If you set `dataType` to `binary`, `myQueueItem` will be a `Buffer`. Otherwise, `myQueueItem` will either be a `string` or possibly a parsed object if the string was JSON.

In v4, we don't allow users to change `myQueueItem` to a `Buffer` type, which we should. This does not apply to http triggers, but probably applies to several other triggers/bindings other than storage queue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.