request-body-problem
@azure-tools/typespec-azure-core/request-body-problemRequest body should not be of raw array type.
Request body should not be of raw array type. Using an array as the top-level request body prevents adding new properties in the future without introducing breaking changes. Instead, create a container model that wraps the array.
Impact
Section titled “Impact”- Area: API, SDK
A request body typed as a bare array is difficult to evolve, since new properties cannot be added later.
❌ Incorrect
Section titled “❌ Incorrect”Raw array as request body:
op upload(@body body: string[]): string;✅ Correct
Section titled “✅ Correct”Wrap the array in a model:
model StringList { value: string[];}
op upload(@body body: StringList): string;op list(@body body: string): string[];Suppression
Section titled “Suppression”Suppress for actions where an array body is appropriate; otherwise wrap the array in a keyed model property so new properties can be added in the future.