( endpoint: HttpApiEndpoint.Top )
| 1122 | } |
| 1123 | |
| 1124 | function makeErrorSchema( |
| 1125 | endpoint: HttpApiEndpoint.Top |
| 1126 | ): Schema.ConstraintEncoder<HttpServerResponse, unknown> { |
| 1127 | const schemas = HttpApiEndpoint.getErrorSchemas(endpoint).map(toResponseErrorSchema) |
| 1128 | if (schemas.length === 0) return Schema.Never |
| 1129 | return schemas.length === 1 ? schemas[0] : Schema.Union(schemas) |
| 1130 | } |
| 1131 | |
| 1132 | function toResponseSchema(getStatus: (schema: Schema.Constraint) => number) { |
| 1133 | // WithHeaders wrappers share a single declaration AST, so they are cached by instance |
no test coverage detected