This is a summary and continuation of two discussions:
As in openapi specification we are aware of possible error responses there should be an easy way to express that in sttp.
That would require adding another generic parameter to ResponseError , while default ResponseError would be still parametrized by String type.
Additional ResponseError type is needed in order to represent unmapped error codes.
All existing functions which deals with ResponseError (like asJsonAlwaysUnsafe) need to be refined.