Of course nature abhors a vacuum and developers create frameworks and specifications which are very helpful here. Most common solution was created by OpenAPI Initiative. Here you can find detailed description of OpenAPI specification. We also have great tools which can present API in readable for humans format:

Above tools are very helpful during developing and testing APIs, especially when you are working in a team and testers aren’t technical people and/or they cannot read the source code. Of course you can use that specification also for generating documentation for other people like product owners, technical writers or customers.

The question now arises: how to use OpenAPI specification in Swift projects? I tried to found some framework or other way to achieve that, but I failed. I didn’t found any solution that I would be happy with. For .NET projects there is for example great project: Swashbuckle (and Swashbucle.AspNetCore). It uses reflection for generating OpenAPI specification and I would like to have something similar for Swift.