(endpoint: Top)
| 281 | |
| 282 | /** @internal */ |
| 283 | export function getErrorSchemas(endpoint: Top): Array<Schema.Top> { |
| 284 | const schemas = new Set<Schema.Top>(endpoint.error) |
| 285 | for (const middleware of endpoint.middlewares) { |
| 286 | const key = middleware as any as HttpApiMiddleware.AnyService |
| 287 | for (const schema of key.error) { |
| 288 | schemas.add(schema) |
| 289 | } |
| 290 | } |
| 291 | return Array.from(schemas) |
| 292 | } |
| 293 | |
| 294 | /** |
| 295 | * A widened `HttpApiEndpoint` type used when the concrete method, path, schemas, |