@@ -4217,7 +4217,112 @@ func (request *PermissionRequest) UnmarshalJSON(data []byte) error {
42174217 data = normalizeStringFieldsToArray (data , "Actions" , "actions" )
42184218 type alias PermissionRequest
42194219 var raw alias
4220- if err := json .Unmarshal (data , & raw ); err != nil {
4220+ if err := json .Unmarshal (stripJSONAliasFields (data ,
4221+ "ID" ,
4222+ "id" ,
4223+ "RequestID" ,
4224+ "request_id" ,
4225+ "requestId" ,
4226+ "requestID" ,
4227+ "PermissionID" ,
4228+ "permission_id" ,
4229+ "permissionId" ,
4230+ "permissionID" ,
4231+ "ToolUseID" ,
4232+ "tool_use_id" ,
4233+ "toolUseId" ,
4234+ "toolUseID" ,
4235+ "OperationID" ,
4236+ "operation_id" ,
4237+ "operationId" ,
4238+ "operationID" ,
4239+ "ToolName" ,
4240+ "tool_name" ,
4241+ "toolName" ,
4242+ "Tool" ,
4243+ "tool" ,
4244+ "Name" ,
4245+ "name" ,
4246+ "Operation" ,
4247+ "operation" ,
4248+ "Command" ,
4249+ "command" ,
4250+ "CommandName" ,
4251+ "command_name" ,
4252+ "commandName" ,
4253+ "ToolTitle" ,
4254+ "tool_title" ,
4255+ "toolTitle" ,
4256+ "Path" ,
4257+ "path" ,
4258+ "FilePath" ,
4259+ "file_path" ,
4260+ "filePath" ,
4261+ "TargetPath" ,
4262+ "target_path" ,
4263+ "targetPath" ,
4264+ "ResourcePath" ,
4265+ "resource_path" ,
4266+ "resourcePath" ,
4267+ "WorkingDirectory" ,
4268+ "working_directory" ,
4269+ "workingDirectory" ,
4270+ "Cwd" ,
4271+ "cwd" ,
4272+ "Target" ,
4273+ "target" ,
4274+ "Resource" ,
4275+ "resource" ,
4276+ "URI" ,
4277+ "uri" ,
4278+ "URL" ,
4279+ "url" ,
4280+ "File" ,
4281+ "file" ,
4282+ "Filename" ,
4283+ "filename" ,
4284+ "Description" ,
4285+ "description" ,
4286+ "Prompt" ,
4287+ "prompt" ,
4288+ "Message" ,
4289+ "message" ,
4290+ "Reason" ,
4291+ "reason" ,
4292+ "ReasonText" ,
4293+ "reason_text" ,
4294+ "reasonText" ,
4295+ "Summary" ,
4296+ "summary" ,
4297+ "Details" ,
4298+ "details" ,
4299+ "Body" ,
4300+ "body" ,
4301+ "Text" ,
4302+ "text" ,
4303+ "Content" ,
4304+ "content" ,
4305+ "Actions" ,
4306+ "actions" ,
4307+ "Options" ,
4308+ "options" ,
4309+ "Choices" ,
4310+ "choices" ,
4311+ "AllowedActions" ,
4312+ "allowed_actions" ,
4313+ "allowedActions" ,
4314+ "AvailableActions" ,
4315+ "available_actions" ,
4316+ "availableActions" ,
4317+ "ActionChoices" ,
4318+ "action_choices" ,
4319+ "actionChoices" ,
4320+ "Buttons" ,
4321+ "buttons" ,
4322+ "ActionsList" ,
4323+ "actions_list" ,
4324+ "actionsList" ,
4325+ ), & raw ); err != nil {
42214326 return err
42224327 }
42234328 * request = PermissionRequest (raw )
@@ -4227,19 +4332,19 @@ func (request *PermissionRequest) UnmarshalJSON(data []byte) error {
42274332 return err
42284333 }
42294334 if request .ID == "" {
4230- request .ID = scalarStringJSONField (fields , "request_id" , "requestId" , "requestID" , "permission_id" , "permissionId" , "permissionID" , "tool_use_id" , "toolUseId" , "toolUseID" , "operation_id " , "operationId " , "operationID " , "id " )
4335+ request .ID = scalarStringJSONField (fields , "ID" , "id" , "RequestID" , " request_id" , "requestId" , "requestID" , "PermissionID" , " permission_id" , "permissionId" , "permissionID" , "ToolUseID" , " tool_use_id" , "toolUseId" , "toolUseID" , "OperationID " , "operation_id " , "operationId " , "operationID " )
42314336 }
42324337 if request .ToolName == "" {
4233- request .ToolName = stringJSONField (fields , "tool_name" , "toolName" , "tool" , "name" , "operation" , "command" , "command_name" , "commandName" , "tool_title" , "toolTitle" )
4338+ request .ToolName = stringJSONField (fields , "ToolName" , " tool_name" , "toolName" , "Tool" , " tool" , "Name" , " name" , "Operation" , " operation" , "Command" , " command" , "CommandName" , " command_name" , "commandName" , "ToolTitle " , "tool_title" , "toolTitle" )
42344339 }
42354340 if request .Path == "" {
4236- request .Path = stringJSONField (fields , "file_path" , "filePath" , "target_path" , "targetPath" , "resource_path" , "resourcePath" , "working_directory" , "workingDirectory" , "cwd" , "path " , "target" , "resource" , "uri" , "url" , "file" , "filename" )
4341+ request .Path = stringJSONField (fields , "Path" , "path" , "FilePath" , " file_path" , "filePath" , "TargetPath" , " target_path" , "targetPath" , "ResourcePath" , " resource_path" , "resourcePath" , "WorkingDirectory" , " working_directory" , "workingDirectory" , "Cwd" , " cwd" , "Target " , "target" , "Resource" , " resource" , "URI" , " uri" , "URL" , " url" , "File" , " file" , "Filename " , "filename" )
42374342 }
42384343 if request .Description == "" {
4239- request .Description = stringJSONField (fields , "prompt" , "message" , "reason" , "reason_text" , "reasonText" , "summary" , "description " , "details" , "body" , "text" , "content" )
4344+ request .Description = stringJSONField (fields , "Description" , "description" , "Prompt" , " prompt" , "Message" , " message" , "Reason" , " reason" , "ReasonText" , " reason_text" , "reasonText" , "Summary" , " summary" , "Details " , "details" , "Body" , " body" , "Text" , " text" , "Content " , "content" )
42404345 }
42414346 if len (request .Actions ) == 0 {
4242- request .Actions = stringListJSONField (fields , "options" , "choices" , "allowed_actions" , "allowedActions" , "available_actions" , "availableActions" , "action_choices" , "actionChoices" , "buttons" , "actions_list" , "actionsList" )
4347+ request .Actions = stringListJSONField (fields , "Actions" , "actions" , "Options" , " options" , "Choices" , " choices" , "AllowedActions" , " allowed_actions" , "allowedActions" , "AvailableActions" , " available_actions" , "availableActions" , "ActionChoices" , " action_choices" , "actionChoices" , "Buttons" , " buttons" , "ActionsList " , "actions_list" , "actionsList" )
42434348 }
42444349 return nil
42454350}
0 commit comments