Question: I've been a fan of ExpressJs for a long time but in a Youtube video I stumble upon Fastify and wanted to give it a try

I'm struggling in making the [fastify-swagger](https://github.com/fastify/fastify-swagger) plugin work as I assume it should work - dynamic setup to pick up the schema from each route, but I'm certainly missing something 

here's my [test repo](https://github.com/balexandre/invoices-poc-api) that after running, none of my routes appear

my setup for the plugin [is the default one](https://github.com/balexandre/invoices-poc-api/blob/e44a7e6938d359918b7db0e02da2a294e5c46319/src/application.ts#L76-L100)

but all I see is

[![enter image description here](https://i.stack.imgur.com/xS3UI.png)](https://i.stack.imgur.com/xS3UI.png)

I've read in the read me that because of OpenAPI specs, some properties, like `description` are mandatory or will not pick up the route, but I've added in one route, and still does not pick up, I've also added `tags` wondering if that was also mandatory, but nothing...

does anyone know what am I missing? must be a simple thing, but got me puzzled this last few days

Answer: 
I ran into the same issue and ended up solving it by following the first Usage example line-by-line: <https://github.com/fastify/fastify-swagger#usage>

```js
const fastify = require('fastify')()

(async () => {
  // set up swagger
  await fastify.register(require('@fastify/swagger'), {
    ...swagger config
  });

  // define all your routes

  // then call these
  await fastify.ready()
  fastify.swagger()
})();

```
Consider the order in which your plugins are loaded, the routes need to be registered before fastify swagger. If fastify swagger comes first, it doesn't detect any route.