Customizing HttpApiDecodeError responses
Hi! I have an existing API that I want to create API specs for using the
The existing API sends request validation errors with status code 400, in the shape:
But any API spec created with
Since it's technically feasible to map Effect's
1. My generated API docs include only the transformed error type; and
2. A possible implementation of the spec using
- Related to: help-forumServer / API level defect handling
- Related to: platform
HttpApi module. This should allow me to (optionally) crate an alternative implementation using the HttpApiBuilder, but also immediately use it to generate a client, docs, etc.The existing API sends request validation errors with status code 400, in the shape:
But any API spec created with
HttpApi is going to add the following as one of possible errors by default:Since it's technically feasible to map Effect's
HttpApiDecodeError to my own ValidationError, is it possible to provide this mapping to the HttpApi specs, so that:1. My generated API docs include only the transformed error type; and
2. A possible implementation of the spec using
HttpApiBuilder automatically uses this mapper to transform the HttpApiDecodeError into my custom ValidationError before it sends the response?- Related to: help-forumServer / API level defect handling
- Related to: platform
