ElementsProject / ElementsProject/lightning
msggen: Invoice.exposeprivatechannels override drops boolean variant from oneOf
- Dominant language
- C
- Stars
- 3.1k
- Forks
- 1k
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 13
Description
The JSON schema for `invoice.exposeprivatechannels` defines a oneOf with both boolean and array variants (doc/schemas/invoice.json:63-83):
```
"exposeprivatechannels": {
"oneOf": [
{ "type": "boolean" },
{ "type": "array", "items": { "type": "short_channel_id" } },
{ "type": "short_channel_id" }
]
}
```
However, in `contrib/msggen/msggen/model.py:502`, this field is manually overridden to only the array type:
```
InvoiceExposeprivatechannelsField = ArrayField(
itemtype=PrimitiveField("short_channel_id", None, None, added=None, deprecated=None),
dims=1, path=None, description=None, added=None, deprecated=None
)
```
And applied at `model.py:544`:
```
overrides = {
'Invoice.exposeprivatechannels': InvoiceExposeprivatechannelsField,
...
}
```
This causes the generated cln-rpc binding to type the field as `Option>` (cln-rpc/src/model.rs), making it impossible to pass `exposeprivatechannels: true` through the typed API.
Since `msggen` already has UnionField support for oneOf schemas (model.py:369-387), could this override be removed or updated to preserve both variants?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.