core-lightning/cln-rpc
Erik De Smedt eea9c8253b msggen: Choose better when a subfield is optional
**Problem Description**

In previous commits I introduced some new fields to `msggen`.
One example is `CustomMsgResponse` in `cln-grpc/src/notification.rs`.

```rust
pub struct CustomMsgResponse {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub peer_id: Option<PublicKey>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub payload: Option<String>,
}
```

The `peer_id` and `payload` are required parameters.
However, the generated code is still marking them as `Optional`.

This is a choice made by `msggen`. It does this because `payload` and
`peer_id` are recently added fields. By marking the field as optional
the language bindings would also work when used on an older version of
Core-Lightning.

In this scenario. Marking them as optional is overkill.
The `CustomMsgStruct` and `payload` field are created in the same
version of CoreLightning.

This commit solves this behavior.
2024-05-16 14:00:18 +02:00
..
examples cln-rpc: Remove wildcard import from model 2023-07-10 13:47:38 +09:30
src msggen: Choose better when a subfield is optional 2024-05-16 14:00:18 +02:00
Cargo.toml rs: bump crate versions for v24.02.1 2024-03-08 14:53:45 +01:00
Makefile cln-rpc: Update the Makefile to always rebuild each example when the example files themselves are changed 2023-10-30 18:24:23 +01:00
README.md doc: update c-lightning to Core Lightning almost everywhere. 2022-04-07 06:53:26 +09:30

cln-rpc: Talk to Core Lightning