Parameter bag types with index signatures are too lax #413
Labels
priority: low
This PR should be reviewed after all high and medium PRs.
status: in progress
This issue is being worked on.
type: chore
This PR contains changes that are not covered by other types (stylistic, dependency updates, etc).
In several places, inputs that would otherwise be strictly structured contain index signatures which allow the user to specify properties with any key. This prevents the typings from being able to catch misspellings and other mistakes. Specifically, in argument "bags".
For example,
PublishParameters
contains an index signature "for deprecated parameters", but this allows the following misspelling without any warning or error:Without the index signature, Typescript would flag
storeInHistor
with the error:Object literal may only specify known properties, but 'storeInHistor' does not exist in type 'PublishParameters'. Did you mean to write 'storeInHistory'?
Rather than an index signature, deprecated params should be explicitly listed but marked as deprecated. Or, a dedicated subkey or alternate param should be provided for specifying arbitrary keys which are merged when sent to the API.
The text was updated successfully, but these errors were encountered: