Skip to content

Unify multipart upload endpoints - #2865

Closed
jjnesbitt wants to merge 4 commits into
masterfrom
unify-multipart-uploads
Closed

Unify multipart upload endpoints#2865
jjnesbitt wants to merge 4 commits into
masterfrom
unify-multipart-uploads

Conversation

@jjnesbitt

@jjnesbitt jjnesbitt commented Jul 16, 2026

Copy link
Copy Markdown
Member

This PR unifies the zarr and asset blob multipart upload endpoints into the singular existing assetblob upload endpoint. The prior change in #2784 was merged to master, but not deployed to production.

This change is intended to be backwards compatible with the CLI, as it simply extends the fields present in both the upload initialize and upload complete endpoints. The existing CLI PR (dandi/dandi-cli#1839) that was pointed at the previous change in #2784 can either be reworked, or replaced with a new PR.

Comment on lines +113 to +123
class UploadValidationResponseSerializer(AssetBlobSerializer):
# Zarr fields, null for asset blob uploads. The inherited AssetBlob
# fields are likewise null for zarr uploads.
zarr_id = serializers.UUIDField(allow_null=True, default=None)
chunk_key = serializers.CharField(allow_null=True, default=None)

class Meta(AssetBlobSerializer.Meta):
fields = [*AssetBlobSerializer.Meta.fields, 'zarr_id', 'chunk_key']
# Default the inherited AssetBlob fields to null so the zarr case only
# needs to supply its own fields.
extra_kwargs = {field: {'default': None} for field in AssetBlobSerializer.Meta.fields}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sort of ugly, but the intent was to avoid simply duplicating the fields from AssetBlobSerializer, in case anything were to change in the future.

@jjnesbitt
jjnesbitt marked this pull request as ready for review July 16, 2026 16:52
@jjnesbitt
jjnesbitt marked this pull request as draft July 16, 2026 20:19
@jjnesbitt

Copy link
Copy Markdown
Member Author

Closed in favor of #2869

@jjnesbitt jjnesbitt closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant