Skip to main content

objectiveai_cli_sdk/output/notification/
notification.rs

1use serde::{Deserialize, Serialize};
2
3/// Wrapper that nests the notification payload one level deeper under a
4/// `value` field. Required because [`super::super::Output`] uses
5/// `#[serde(tag = "type")]` — if we let `T` flatten directly into the
6/// outer JSON object, any `T` carrying its own `"type"` field (e.g. a
7/// JSON Schema document with `"type": "object"`) would collide with
8/// the discriminator.
9///
10/// Wire (in combination with `Output::Notification`):
11/// `{"type":"notification","value":<T>}`.
12#[derive(Serialize, Deserialize, Debug, Clone)]
13pub struct Notification<T> {
14    pub value: T,
15}