pub enum ApplyPatchOperation {
CreateFile {
diff: String,
path: String,
},
DeleteFile {
path: String,
},
UpdateFile {
diff: String,
path: String,
},
}Expand description
File-edit operation payload carried by
ResponseInputOutputItem::ApplyPatchCall /
ResponseOutputItem::ApplyPatchCall.
Spec (openai-responses-api-spec.md §ApplyPatchCall L240-L246): the
operation field is a type-tagged union of three shapes —
CreateFile { diff, path, type: "create_file" },
DeleteFile { path, type: "delete_file" }, and
UpdateFile { diff, path, type: "update_file" }. DeleteFile carries no
diff because the whole file is removed; the other two carry a unified
diff payload describing the edit.
deny_unknown_fields is applied so variants fail fast on foreign keys —
e.g. {"type":"delete_file","path":"x","diff":"..."} is rejected rather
than silently dropping the stray diff, matching the P5 fail-fast
contract applied elsewhere on protocol-surface structs.
Variants§
CreateFile
{ type: "create_file", diff, path } — create a new file whose
contents are described by diff.
DeleteFile
{ type: "delete_file", path } — remove an existing file.
UpdateFile
{ type: "update_file", diff, path } — apply a unified diff to an
existing file at path.
Trait Implementations§
Source§impl Clone for ApplyPatchOperation
impl Clone for ApplyPatchOperation
Source§fn clone(&self) -> ApplyPatchOperation
fn clone(&self) -> ApplyPatchOperation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ApplyPatchOperation
impl Debug for ApplyPatchOperation
Source§impl<'de> Deserialize<'de> for ApplyPatchOperation
impl<'de> Deserialize<'de> for ApplyPatchOperation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ApplyPatchOperation
impl JsonSchema for ApplyPatchOperation
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more