fix(resources): preserve multipart file uploads in generated client (HYBIM-882)#104
Open
etserend wants to merge 2 commits into
Open
fix(resources): preserve multipart file uploads in generated client (HYBIM-882)#104etserend wants to merge 2 commits into
etserend wants to merge 2 commits into
Conversation
…02ce8bb) Port of rungalileo/galileo-python@02ce8bb2 — fix: Preserve multipart file uploads in generated client (#624). - openapi.yaml: replace contentMediaType: application/octet-stream with format: binary for 7 Body_* multipart file fields so openapi-python-client generates File-typed attributes instead of plain str - scripts/import-openapi-yaml.sh: add yq patches for the 7 binary fields so the fix survives future openapi.yaml regenerations; tighten error handling - 6 generated Body_* models: update file fields from str → File, add BytesIO import, add File/FileTypes imports, call .to_tuple() in to_dict/to_multipart, construct File(payload=BytesIO(...)) in from_dict - tests/test_datasets.py: add two tests verifying File payloads round-trip through to_multipart() correctly
…ation block Two gaps vs upstream 02ce8bb: - ListAnnotationQueueParams.properties.sort.default patch was missing (added in e34a5b1 / PR#103 but not carried forward to this branch) - Post-patch verification block (yq -e with 14 assertions) was absent - Error message corrected: "Failed to fetch..." -> "Failed to patch..."
etserend
marked this pull request as ready for review
July 21, 2026 16:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port of upstream commit
02ce8bb— fix: Preserve multipart file uploads in generated client (#624).openapi.yaml: ReplacecontentMediaType: application/octet-stream→format: binaryfor 7Body_*multipart file fields, enablingopenapi-python-clientto generateFile-typed attributes instead of plainstrscripts/import-openapi-yaml.sh: Addyqpatches for the 7 binary fields so the fix survives futureopenapi.yamlregenerations; tighten error handling ($? -ne 0)Body_*models:file: str→file: File; addBytesIO/File/FileTypesimports; call.to_tuple()into_dict/to_multipart; constructFile(payload=BytesIO(...))infrom_dicttests/test_datasets.py: 2 new tests verifyingFilepayloads round-trip throughto_multipart()correctlyTest plan
poetry run pytest tests/test_datasets.py -v— 61 passedtest_create_dataset_body_serializes_file_as_multipart_upload,test_code_scorer_bodies_serialize_files_as_multipart_uploadsregenerate-api-clientworkflow after merge to produce clean generated output