mirror of
https://github.com/openai/codex.git
synced 2026-09-05 15:18:41 +00:00
`#[serde(default)]` wasn't sufficient for our generated TS types to reflect that clients didn't have to set them. We also need `skip_serializing_if = "std::ops::Not::not"`. This is already a rule in our agents.md file.
31 lines
928 B
Rust
31 lines
928 B
Rust
use schemars::JsonSchema;
|
|
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
use std::collections::BTreeMap;
|
|
use std::path::PathBuf;
|
|
use ts_rs::TS;
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct FeedbackUploadParams {
|
|
pub classification: String,
|
|
#[ts(optional = nullable)]
|
|
pub reason: Option<String>,
|
|
#[ts(optional = nullable)]
|
|
pub thread_id: Option<String>,
|
|
#[serde(default, skip_serializing_if = "std::ops::Not::not")]
|
|
pub include_logs: bool,
|
|
#[ts(optional = nullable)]
|
|
pub extra_log_files: Option<Vec<PathBuf>>,
|
|
#[ts(optional = nullable)]
|
|
pub tags: Option<BTreeMap<String, String>>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct FeedbackUploadResponse {
|
|
pub thread_id: String,
|
|
}
|