Skip to content

msggen: Invoice.exposeprivatechannels override drops boolean variant from oneOf #8961

@4xvgal

Description

@4xvgal

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<Vec<ShortChannelId>> (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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions