Creating a composable schema for your HTTP client involves defining TypeScript types for the succ...
Hi, i am creating cutom http client for a backend endpoint, which has defined structure of success response and error response which are
how can i make these schema composable for
now i am creating custom http client,
i want to transform my response based on the response body and not status, if body has success schema structure then it should succeed with success response schema, else if it has error schema structure then it should fail with error response schema, if both are not valid, then it should fail with MalformedServerResponseError.
can anyone guide me through this?
how can i make these schema composable for
data property, since i want to pass schema for the expected data from endpoint. same for error schema, data can be based on the error code, example, code E_VALIDATION_ERROR will have data property.now i am creating custom http client,
i want to transform my response based on the response body and not status, if body has success schema structure then it should succeed with success response schema, else if it has error schema structure then it should fail with error response schema, if both are not valid, then it should fail with MalformedServerResponseError.
can anyone guide me through this?
