byos
@azure-tools/typespec-azure-core/byosOperations that upload binary data (using content types like application/octet-stream or multipart/form-data) should use the Bring Your Own Storage (BYOS) pattern recommended for Azure Services.
See the Azure REST API Guidelines - BYOS for more details.
โ Incorrect
Section titled โโ IncorrectโUploading binary data with application/octet-stream:
op uploadFile(data: bytes, @header contentType: "application/octet-stream"): void;Uploading with multipart/form-data:
op uploadFile( @multipartBody data: { data: HttpPart<bytes>; }, @header contentType: "multipart/form-data",): void;โ Correct
Section titled โโ CorrectโUse the BYOS pattern where the client provides a storage location, instead of directly accepting binary data in the request body.
op download(): { data: bytes; @header contentType: "application/octet-stream";};