-
Notifications
You must be signed in to change notification settings - Fork 400
Closed
Labels
priority: lowThis PR should be reviewed after all high and medium PRs.This PR should be reviewed after all high and medium PRs.status: in progressThis issue is being worked on.This issue is being worked on.type: refactorThis PR contains refactored existing features.This PR contains refactored existing features.
Description
It looks like the Payload
type used by PublishParameters.message
attempts to ensure the value contains only valid JSON types, but using this type on inputs prevents users from utilizing the JSON serialization layer. Namely, classes/objects with custom JSON serialization via toJSON()
: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#tojson_behavior
For example, instances of Date
. Another example is that undefined
is not allowed even though JSON serialization excludes those properties automatically.
I suggest using unknown
instead of Payload
.
The workaround is to use the any
trapdoor which defeats the purpose of the typing entirely.
Metadata
Metadata
Assignees
Labels
priority: lowThis PR should be reviewed after all high and medium PRs.This PR should be reviewed after all high and medium PRs.status: in progressThis issue is being worked on.This issue is being worked on.type: refactorThis PR contains refactored existing features.This PR contains refactored existing features.