schemas: "description" field in "wait(any)invoice" is optional since BOLT12

For BOLT12 invoices, the "description" is field missing in the invoice
responses. Update the schemas accordingly:

- `doc/schemas/lightning-waitanyinvoice.json`
- `doc/schemas/lightning-waitinvoice.json`

Also commit the generated msggen, cln-grpc, cln-rpc and pyln-grpc-proto files.

Changelog-Fixed: schemas: Make description in `Wait(any)invoiceResponse` optional to handle BOLT12
This commit is contained in:
laanwj 2024-09-13 12:09:38 +02:00 committed by Rusty Russell
parent 5bd3d51131
commit c8660c85ba
7 changed files with 712 additions and 714 deletions

View file

@ -1077,7 +1077,7 @@ message WaitanyinvoiceResponse {
EXPIRED = 1;
}
string label = 1;
string description = 2;
optional string description = 2;
bytes payment_hash = 3;
WaitanyinvoiceStatus status = 4;
uint64 expires_at = 5;
@ -1109,7 +1109,7 @@ message WaitinvoiceResponse {
EXPIRED = 1;
}
string label = 1;
string description = 2;
optional string description = 2;
bytes payment_hash = 3;
WaitinvoiceStatus status = 4;
uint64 expires_at = 5;

View file

@ -957,7 +957,7 @@ impl From<responses::WaitanyinvoiceResponse> for pb::WaitanyinvoiceResponse {
bolt11: c.bolt11, // Rule #2 for type string?
bolt12: c.bolt12, // Rule #2 for type string?
created_index: c.created_index, // Rule #2 for type u64?
description: c.description, // Rule #2 for type string
description: c.description, // Rule #2 for type string?
expires_at: c.expires_at, // Rule #2 for type u64
label: c.label, // Rule #2 for type string
paid_at: c.paid_at, // Rule #2 for type u64?
@ -990,7 +990,7 @@ impl From<responses::WaitinvoiceResponse> for pb::WaitinvoiceResponse {
bolt11: c.bolt11, // Rule #2 for type string?
bolt12: c.bolt12, // Rule #2 for type string?
created_index: c.created_index, // Rule #2 for type u64?
description: c.description, // Rule #2 for type string
description: c.description, // Rule #2 for type string?
expires_at: c.expires_at, // Rule #2 for type u64
label: c.label, // Rule #2 for type string
paid_at: c.paid_at, // Rule #2 for type u64?

6
cln-rpc/src/model.rs generated
View file

@ -5691,6 +5691,8 @@ pub mod responses {
#[serde(skip_serializing_if = "Option::is_none")]
pub created_index: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub paid_at: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub paid_outpoint: Option<WaitanyinvoicePaid_outpoint>,
@ -5702,7 +5704,6 @@ pub mod responses {
pub updated_index: Option<u64>,
// Path `WaitAnyInvoice.status`
pub status: WaitanyinvoiceStatus,
pub description: String,
pub expires_at: u64,
pub label: String,
pub payment_hash: Sha256,
@ -5767,6 +5768,8 @@ pub mod responses {
#[serde(skip_serializing_if = "Option::is_none")]
pub created_index: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub paid_at: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub paid_outpoint: Option<WaitinvoicePaid_outpoint>,
@ -5778,7 +5781,6 @@ pub mod responses {
pub updated_index: Option<u64>,
// Path `WaitInvoice.status`
pub status: WaitinvoiceStatus,
pub description: String,
pub expires_at: u64,
pub label: String,
pub payment_hash: Sha256,

View file

@ -33516,7 +33516,6 @@
"response": {
"required": [
"label",
"description",
"payment_hash",
"status",
"created_index",
@ -33877,7 +33876,6 @@
"response": {
"required": [
"label",
"description",
"payment_hash",
"status",
"created_index",

File diff suppressed because one or more lines are too long

View file

@ -29,7 +29,6 @@
"response": {
"required": [
"label",
"description",
"payment_hash",
"status",
"created_index",

View file

@ -30,7 +30,6 @@
"response": {
"required": [
"label",
"description",
"payment_hash",
"status",
"created_index",