There are various tools that will do some of this, utoipa [1] for rust and
play-swagger [2] for scala + play that I've used in the past and enjoyed. They generate a significant portion of your spec for you, then a client can be generated from the spec.