@@ -4165,22 +4165,65 @@ func (expect *PromptExpectation) UnmarshalJSON(data []byte) error {
41654165 "emptyPrompt" ,
41664166 "blank" ,
41674167 )
4168- data = normalizeObjectFieldsToArray (data , "pasted_contents" , "pastedContents" )
4168+ data = normalizeObjectFieldsToArray (data , "PastedContents" , " pasted_contents" , "pastedContents" )
41694169 type alias PromptExpectation
41704170 var raw alias
4171- if err := json .Unmarshal (data , & raw ); err != nil {
4171+ if err := json .Unmarshal (stripJSONAliasFields (data ,
4172+ "Text" ,
4173+ "text" ,
4174+ "value" ,
4175+ "input" ,
4176+ "content" ,
4177+ "message" ,
4178+ "prompt" ,
4179+ "prompt_text" ,
4180+ "promptText" ,
4181+ "input_text" ,
4182+ "inputText" ,
4183+ "Expanded" ,
4184+ "expanded" ,
4185+ "expanded_text" ,
4186+ "expandedText" ,
4187+ "expanded_prompt" ,
4188+ "expandedPrompt" ,
4189+ "expanded_value" ,
4190+ "expandedValue" ,
4191+ "full_text" ,
4192+ "fullText" ,
4193+ "Cursor" ,
4194+ "cursor" ,
4195+ "cursor_index" ,
4196+ "cursorIndex" ,
4197+ "cursor_position" ,
4198+ "cursorPosition" ,
4199+ "caret" ,
4200+ "position" ,
4201+ "Empty" ,
4202+ "empty" ,
4203+ "is_empty" ,
4204+ "isEmpty" ,
4205+ "empty_prompt" ,
4206+ "emptyPrompt" ,
4207+ "blank" ,
4208+ "PastedContentCount" ,
4209+ "pasted_content_count" ,
4210+ "pastedContentCount" ,
4211+ "PastedContents" ,
4212+ "pasted_contents" ,
4213+ "pastedContents" ,
4214+ "NextPastedID" ,
4215+ "next_pasted_id" ,
4216+ "nextPastedId" ,
4217+ "nextPastedID" ,
4218+ ), & raw ); err != nil {
41724219 return err
41734220 }
41744221 * expect = PromptExpectation (raw )
41754222
41764223 var fields struct {
4177- PastedContentCount * int `json:"pasted_content_count"`
4178- PastedContentCountCamel * int `json:"pastedContentCount"`
4179- PastedContents []PastedContentExpectation `json:"pasted_contents"`
4180- PastedContentsCamel []PastedContentExpectation `json:"pastedContents"`
4181- NextPastedID * int `json:"next_pasted_id"`
4182- NextPastedIDAlt * int `json:"nextPastedId"`
4183- NextPastedIDUpper * int `json:"nextPastedID"`
4224+ PastedContents []PastedContentExpectation `json:"PastedContents"`
4225+ PastedContentsSnake []PastedContentExpectation `json:"pasted_contents"`
4226+ PastedContentsCamel []PastedContentExpectation `json:"pastedContents"`
41844227 }
41854228 if err := json .Unmarshal (data , & fields ); err != nil {
41864229 return err
@@ -4190,37 +4233,31 @@ func (expect *PromptExpectation) UnmarshalJSON(data []byte) error {
41904233 return err
41914234 }
41924235 if expect .Text == "" {
4193- expect .Text = stringJSONField (fieldMap , "value" , "input" , "content" , "message" , "prompt" , "prompt_text" , "promptText" , "input_text" , "inputText" )
4236+ expect .Text = stringJSONField (fieldMap , "Text" , "text" , " value" , "input" , "content" , "message" , "prompt" , "prompt_text" , "promptText" , "input_text" , "inputText" )
41944237 }
41954238 if expect .Expanded == "" {
4196- expect .Expanded = stringJSONField (fieldMap , "expanded_text" , "expandedText" , "expanded_prompt" , "expandedPrompt" , "expanded_value" , "expandedValue" , "full_text" , "fullText" )
4239+ expect .Expanded = stringJSONField (fieldMap , "Expanded" , "expanded" , " expanded_text" , "expandedText" , "expanded_prompt" , "expandedPrompt" , "expanded_value" , "expandedValue" , "full_text" , "fullText" )
41974240 }
41984241 if expect .Cursor == nil {
4199- expect .Cursor = intPtrJSONField (fieldMap , "cursor_index" , "cursorIndex" , "cursor_position" , "cursorPosition" , "caret" , "position" )
4242+ expect .Cursor = intPtrJSONField (fieldMap , "Cursor" , "cursor" , " cursor_index" , "cursorIndex" , "cursor_position" , "cursorPosition" , "caret" , "position" )
42004243 }
4201- if empty := boolPtrJSONField (fieldMap , "is_empty" , "isEmpty" , "empty_prompt" , "emptyPrompt" , "blank" ); empty != nil {
4244+ if empty := boolPtrJSONField (fieldMap , "Empty" , "empty" , " is_empty" , "isEmpty" , "empty_prompt" , "emptyPrompt" , "blank" ); empty != nil {
42024245 expect .Empty = * empty
42034246 }
4204- if fields .PastedContentCount != nil {
4205- expect .PastedContentCount = fields .PastedContentCount
4206- }
4207- if fields .PastedContentCountCamel != nil {
4208- expect .PastedContentCount = fields .PastedContentCountCamel
4247+ if expect .PastedContentCount == nil {
4248+ expect .PastedContentCount = intPtrJSONField (fieldMap , "PastedContentCount" , "pasted_content_count" , "pastedContentCount" )
42094249 }
42104250 if fields .PastedContents != nil {
42114251 expect .PastedContents = fields .PastedContents
42124252 }
4253+ if fields .PastedContentsSnake != nil {
4254+ expect .PastedContents = fields .PastedContentsSnake
4255+ }
42134256 if fields .PastedContentsCamel != nil {
42144257 expect .PastedContents = fields .PastedContentsCamel
42154258 }
4216- if fields .NextPastedID != nil {
4217- expect .NextPastedID = fields .NextPastedID
4218- }
4219- if fields .NextPastedIDAlt != nil {
4220- expect .NextPastedID = fields .NextPastedIDAlt
4221- }
4222- if fields .NextPastedIDUpper != nil {
4223- expect .NextPastedID = fields .NextPastedIDUpper
4259+ if expect .NextPastedID == nil {
4260+ expect .NextPastedID = intPtrJSONField (fieldMap , "NextPastedID" , "next_pasted_id" , "nextPastedId" , "nextPastedID" )
42244261 }
42254262 return nil
42264263}
0 commit comments