Binding interface does not support excess properties
- Dominant language
- TypeScript
- Stars
- 144
- Forks
- 144
- Avg merge
- 6m
- Merged PRs (30d)
- 11
Description
#### Describe the bug
The OldServer, ServerV2, and Server classes do not support excess properties on the Binding interface.
#### How to Reproduce
using "@asyncapi/parser": "^2.0.0-next-major.15"
```ts
import { OldAsyncAPIDocument, OldServer } from '@asyncapi/parser'
//inside an exported class
private _AsyncAPIServer: OldServer
get AsyncAPIServer(): OldServer {
return this._AsyncAPIServer
}
//in another file with a class that extends the class above
const mqttServerBinding = this.AsyncAPIServer.binding('mqtt')
const mqtt5ServerBinding = this.AsyncAPIServer.binding('mqtt5')
const serverBinding = protocolVersion === 5 ? mqtt5ServerBinding : mqttServerBinding
mqtt.connect({
...
clientId: serverBinding?.clientId ?? auth?.clientId,
clean: serverBinding?.cleanSession,
...
})
```
An error is thrown that `clientId` does not exist on type `Binding`.

The Binding interface

#### Expected behavior
The Binding interface should support excess properties possibly by using `[propName: string]: any;`
Contributor guide
Research direction
Start by locating the Binding interface and the OldServer, ServerV2, and Server binding() entry points in @asyncapi/parser. Check how mqtt and mqtt5 bindings are typed, then verify that clientId and cleanSession are accepted on the returned bindings without breaking existing type checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100