Swagger is a tool for writing documentation for your API. Is as simple as that. When you write an API, you often want people to know how to use it, what routes to hit, what data to pass through and what are the expected results. You use Swagger to achieve that. But you can dive more into the concept from their official website.