Just released swagger codegen for Vapor 4: https://github.com/thecheatah/vapor-server-codegen
Use a docker image to produce a SwiftPM package that defines API protocols, models and routes. Your Vapor 4 can create a dependency on the generated package and implement the interfaces and call the route configuration function. It is well documented and tested. Please take a look at the github project for more information.