sequelize-to-json-schemas icon indicating copy to clipboard operation
sequelize-to-json-schemas copied to clipboard

Authentication route is not displaying in feathers swagger

Open justraman opened this issue 4 years ago • 0 comments

After using this library, the docs have only model routes, authentication route is completely invisible.

app.configure(sequelize);



// Configure other middleware (see `middleware/index.js`)
app.configure(middleware);
app.configure(authentication);



app.configure(sequelizeToJsonSchemas as any);

app.configure(
    swagger({
      openApiVersion: 3,
      uiIndex: true,
      docsPath: '/docs',
      docsJsonPath: '/docs/schema',
      specs: {
        info: {
          title: 'XYZ',
          description: 'Documentaition by [@justraman](https://github.com/justraman)',
          version: '0.0.1',
        },
      },
      defaults: {
        schemasGenerator(service, model, modelName) {
          const modelSchema = app
            .get('jsonSchemaManager')
            .generate(
              service.options.Model,
              app.get('openApi3Strategy'),
              service.options.Model.options.jsonSchema,
            );
  
          return {
            [model]: modelSchema,
            [`${model}_list`]: {
              title: `${modelName} list`,
              type: 'array',
              items: { $ref: `#/components/schemas/${model}` },
            },
          };
        },
      },
    }),
  )
// Set up our services (see `services/index.js`)
app.configure(services);



// Set up event channels (see channels.js)
app.configure(channels);

// Configure a middleware for 404s and the error handler
app.use(express.notFound());
app.use(express.errorHandler({ logger } as any));

app.hooks(appHooks);

justraman avatar Jun 03 '20 05:06 justraman