Skip to content

Fix multiple image edit uploads#311

Draft
jbeckwith-oai wants to merge 1 commit into
mainfrom
codex/fix-image-edit-multipart-array
Draft

Fix multiple image edit uploads#311
jbeckwith-oai wants to merge 1 commit into
mainfrom
codex/fix-image-edit-multipart-array

Conversation

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Summary

  • encode multiple image edit uploads using the API's bracketed image[] multipart field
  • preserve the existing scalar image field for single-image edits
  • cover both non-streaming and streaming image edits with multipart regression tests

Root cause

The generated multipart encoder flattened arrays of file inputs but reused the scalar field name for every part. The Images API therefore received duplicate image parameters instead of an image[] array and returned duplicate_parameter.

This applies the array field name only to image edit requests, avoiding a behavior change for unrelated multipart array parameters.

Fixes #201.

Validation

  • ruby -Itest test/openai/resources/images_test.rb --name '/test_edit_(encodes_multiple_images_as_an_array_multipart_field|preserves_the_scalar_image_multipart_field)/'
  • ruby -Itest test/openai/internal/util_test.rb
  • rubocop --force-exclusion lib/openai/resources/images.rb test/openai/resources/images_test.rb
  • live API contract check: the request now reaches image validation (invalid_image_file) instead of failing with duplicate_parameter

@jbeckwith-oai jbeckwith-oai added the generator Touches generated SDK files label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

generator Touches generated SDK files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editing multiple images is broken

1 participant