( api: HttpApi.HttpApi.AnyWithProps )
| 768 | } |
| 769 | |
| 770 | const makeErrorSchema = ( |
| 771 | api: HttpApi.HttpApi.AnyWithProps |
| 772 | ): Schema.Schema<unknown, HttpServerResponse.HttpServerResponse> => { |
| 773 | const schemas = new Set<Schema.Schema.Any>() |
| 774 | HttpApiSchema.deunionize(schemas, api.errorSchema) |
| 775 | for (const group of Object.values(api.groups)) { |
| 776 | for (const endpoint of Object.values(group.endpoints)) { |
| 777 | HttpApiSchema.deunionize(schemas, endpoint.errorSchema) |
| 778 | } |
| 779 | HttpApiSchema.deunionize(schemas, group.errorSchema) |
| 780 | } |
| 781 | return Schema.Union(...Array.from(schemas, toResponseError)) as any |
| 782 | } |
| 783 | |
| 784 | const decodeForbidden = <A>(_: A, __: AST.ParseOptions, ast: AST.Transformation) => |
| 785 | ParseResult.fail(new ParseResult.Forbidden(ast, _, "Encode only schema")) |
no test coverage detected
searching dependent graphs…