Swagger to Vapor 3 Code Generator

(Ravneet Singh) #1

Hi, If you would like to ease API development and like to use Swagger, I have created a swagger-codegen language plugin called SwiftVapor3 located here: https://github.com/thecheatah/SwiftVapor-swagger-codegen

This project will intake a swagger spec and produce a swift package that your vapor project can create a dependency on. The built project will have a routes.swift with a function configure a router to conform to the swagger's API specifications, APIs directory with swift protocols that need to be implemented in your project and a Models directory with models from the swagger.

The project includes test projects with tests that validate the codegen's behavior. The test projects can also be used to learn how to consume the generated package.

6 Likes