Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cds/cdl.md
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,21 @@ service CatalogService {

Explicitly modelled binding parameters are ignored for OData V2.

#### Returning Media Data Streams { #actions-returning-media}

Actions and functions can also be modelled to return streamed media data like images, CSVs, etc. In order to do so, the action or function's return type has to refer to a [predefined type](#types) annotated with [media data annotations](/guides/providing-services#annotating-media-elements) that is defined in the same service. The minimum set of annotations required is `@Core.MediaType`.

```cds
service CatalogService {
@Core.MediaType: 'image/png' @Core.ContentDisposition.Filename: 'image.png' @Core.ContentDisposition.Type: 'attachment'
type png : LargeBinary;

entity Products as projection on data.Products { ... }
actions {
function image() returns png;
}
}
```

### Custom-Defined Events {#events}

Expand Down