Azure / Azure/azure-functions-nodejs-library
Support changing dataType for a binding in v4
- 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
Assessment
This issue has not been assessed yet.