(schema: Schema.Schema<A, I, R>, options?: ParseOptions)
| 130 | |
| 131 | /** @internal */ |
| 132 | export const jsonSchema = <A, I, R>(schema: Schema.Schema<A, I, R>, options?: ParseOptions) => { |
| 133 | const encode = Schema.encode(schema, options) |
| 134 | return (body: A, contentType?: string): Effect.Effect<Body.Uint8Array, Body.HttpBodyError, R> => |
| 135 | Effect.flatMap( |
| 136 | Effect.mapError(encode(body), (error) => HttpBodyError({ _tag: "SchemaError", error })), |
| 137 | (body) => json(body, contentType) |
| 138 | ) |
| 139 | } |
| 140 | |
| 141 | /** @internal */ |
| 142 | export const file = ( |
nothing calls this directly
no test coverage detected