Error responses
Standard non-2xx response envelopes.
A non-2xx response schema
| Property | Type | Required | Description |
|---|---|---|---|
status | number | Yes | |
message | string | Yes | Human-readable error message. |
errors | unknown[] | Yes | List of errors. |
{ "status": 400, "message": "Error", "errors": []}$schema: https://json-schema.org/draft/2020-12/schema$id: Error.yamltype: objectproperties: status: type: number examples: - 400 message: type: string examples: - Error description: Human-readable error message. errors: type: array items: {} description: List of errors.required: - status - message - errorsdescription: A non-2xx response schema/** A standard error response schema, used to create custom error responses. * * @example How to use this model to create custom error response schemas * * ```typespec * import "@typespec/http"; * * alias Unauthorized = Error & Http.UnauthorizedResponse; * ``` */@error@doc("A non-2xx response schema")@Versioning.added(Versions.v0_1)model Error { @example(400) status: numeric;
/** Human-readable error message. */ @example("Error") message: string;
/** List of errors. */ errors: Array<unknown>;}