Skip to content

no-header-explode

Id
@azure-tools/typespec-azure-core/no-header-explode

It is recommended to serialize header parameter without explode: true

Azure services favor serializing header parameter of array type using the simple style(Where each values is joined by a ,) Using explode: true property specify that each individual value of the array should be sent as a separate header parameter.

  • Area: API

Allowing explode on multi-valued headers is mainly a data-plane concern but should be avoided.

op list(
@header(#{ explode: true })
select: string[],
): Pet[];
op list(
@header
select: string[],
): Pet[];
op list(
@header(#{ explode: false })
select: string[],
): Pet[];

Suppress only when required to match an existing API; otherwise use a different separator for multi-valued headers.