Skip to content

XML: Container.listBlobsFlat BlobMetadata isn't deserialized #3779

@jeremymeng

Description

@jeremymeng

The BlobMetadata has additionalProperties

/** The blob metadata. */
export interface BlobMetadata {
  /** Whether the blob metadata is encrypted. */
  encrypted?: string;
  /** Additional properties */
  additionalProperties?: Record<string, string>;
}

export function blobMetadataDeserializer(item: any): BlobMetadata {
  return {
    additionalProperties: serializeRecord(item, ["encrypted"]),
    encrypted: item["encrypted"],
  };
}

However, it looks that only blobMetadataXmlObjectDeserializer is invoked, and it returns an empty object (when encrypted is undefined.)

export function blobMetadataXmlObjectDeserializer(
  xmlObject: Record<string, unknown>,
): BlobMetadata {
  const properties: XmlPropertyDeserializeMetadata[] = [
    {
      propertyName: "encrypted",
      xmlOptions: { name: "Encrypted", attribute: true },
      type: "primitive",
    },
  ];
  return deserializeXmlObject<BlobMetadata>(xmlObject, properties);
}

The xml payload

<?xml version="1.0" encoding="utf-8"?><EnumerationResults ServiceEndpoint="https://yumengstorage1.blob.core.windows.net/" ContainerName="container177147990216603192"><Prefix>blockblob</Prefix><Blobs><Blob><Name>blockblob/0177147990228203087</Name><VersionId>2026-02-19T05:46:05.2034045Z</VersionId><IsCurrentVersion>true</IsCurrentVersion><Properties><Creation-Time>Thu, 19 Feb 2026 05:46:05 GMT</Creation-Time><Last-Modified>Thu, 19 Feb 2026 05:46:05 GMT</Last-Modified><Etag>0x8DE6F7A2C3C55FD</Etag><Content-Length>0</Content-Length><Content-Type>application/octet-stream</Content-Type><Content-Encoding /><Content-Language /><Content-CRC64 /><Content-MD5>1B2M2Y8AsgTpgAmY7PhCfg==</Content-MD5><Cache-Control /><Content-Disposition /><BlobType>BlockBlob</BlobType><AccessTier>Hot</AccessTier><AccessTierInferred>true</AccessTierInferred><LeaseStatus>unlocked</LeaseStatus><LeaseState>available</LeaseState><ServerEncrypted>true</ServerEncrypted></Properties><Metadata><keya>a</keya><keyb>c</keyb></Metadata><OrMetadata /></Blob><Blob><Name>blockblob/1177147996521203437</Name><VersionId>2026-02-19T05:46:08.5716368Z</VersionId><IsCurrentVersion>true</IsCurrentVersion><Properties><Creation-Time>Thu, 19 Feb 2026 05:46:08 GMT</Creation-Time><Last-Modified>Thu, 19 Feb 2026 05:46:08 GMT</Last-Modified><Etag>0x8DE6F7A2E3E4990</Etag><Content-Length>0</Content-Length><Content-Type>application/octet-stream</Content-Type><Content-Encoding /><Content-Language /><Content-CRC64 /><Content-MD5>1B2M2Y8AsgTpgAmY7PhCfg==</Content-MD5><Cache-Control /><Content-Disposition /><BlobType>BlockBlob</BlobType><AccessTier>Hot</AccessTier><AccessTierInferred>true</AccessTierInferred><LeaseStatus>unlocked</LeaseStatus><LeaseState>available</LeaseState><ServerEncrypted>true</ServerEncrypted></Properties><Metadata><keya>a</keya><keyb>c</keyb></Metadata><OrMetadata /></Blob><Blob><Name>blockblob/2177147996857905011</Name><VersionId>2026-02-19T05:46:51.2853571Z</VersionId><IsCurrentVersion>true</IsCurrentVersion><Properties><Creation-Time>Thu, 19 Feb 2026 05:46:51 GMT</Creation-Time><Last-Modified>Thu, 19 Feb 2026 05:46:51 GMT</Last-Modified><Etag>0x8DE6F7A47B3E243</Etag><Content-Length>0</Content-Length><Content-Type>application/octet-stream</Content-Type><Content-Encoding /><Content-Language /><Content-CRC64 /><Content-MD5>1B2M2Y8AsgTpgAmY7PhCfg==</Content-MD5><Cache-Control /><Content-Disposition /><BlobType>BlockBlob</BlobType><AccessTier>Hot</AccessTier><AccessTierInferred>true</AccessTierInferred><LeaseStatus>unlocked</LeaseStatus><LeaseState>available</LeaseState><ServerEncrypted>true</ServerEncrypted></Properties><Metadata><keya>a</keya><keyb>c</keyb></Metadata><OrMetadata /></Blob><Blob><Name>blockblob/3177148001129209637</Name><VersionId>2026-02-19T05:46:51.3371305Z</VersionId><IsCurrentVersion>true</IsCurrentVersion><Properties><Creation-Time>Thu, 19 Feb 2026 05:46:51 GMT</Creation-Time><Last-Modified>Thu, 19 Feb 2026 05:46:51 GMT</Last-Modified><Etag>0x8DE6F7A47BBC8A9</Etag><Content-Length>0</Content-Length><Content-Type>application/octet-stream</Content-Type><Content-Encoding /><Content-Language /><Content-CRC64 /><Content-MD5>1B2M2Y8AsgTpgAmY7PhCfg==</Content-MD5><Cache-Control /><Content-Disposition /><BlobType>BlockBlob</BlobType><AccessTier>Hot</AccessTier><AccessTierInferred>true</AccessTierInferred><LeaseStatus>unlocked</LeaseStatus><LeaseState>available</LeaseState><ServerEncrypted>true</ServerEncrypted></Properties><Metadata><keya>a</keya><keyb>c</keyb></Metadata><OrMetadata /></Blob></Blobs><NextMarker /></EnumerationResults>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions