As you said, duplicating the status code from the header in the body is a bit odd. But how you design your API should be guided by your requirements and not what technology you are using. You certainly can create such a wrapper type in actix-web. A type RestBean that implements Responder (similar to the built-in Json responder), which you can return from your endpoints, would be the most straight-forward implementation. You could also create a middleware that wraps your endpoints, but I don't recommend that, as extracting the response body from your endpoint in the middleware is cumbersome, complex and brittle.