sonic-express icon indicating copy to clipboard operation
sonic-express copied to clipboard

Can I group the routes based on say resource groups?

Open oneEyedSunday opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. Can I set up sonic-express to group the routes based on resource groups? It currently just dumps everything inside a default group. Screenshot 2022-08-11 at 02 18 43

So, is there a way to set up in such a way that I have business profile and customer-exemption groups?

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context This is my setup.


  const swaggerSpecPath = path.join(__dirname, '../../docs', 'swagger.json');

  const { getResponseExpress } = require('@tiemma/sonic-express');

  const swaggerDefinition = {
    openapi: '3.0.1',
    info: {
      title: 'AtomicKit Server',
      version: process.env.npm_package_version,
      description: 'Tax Software For Businesses',
    },
    servers: [
      {
        url: '/api/v1',
        description: 'Host system path',
      },
    ],
    definitions: {},
    produces: [
      'application/json',
    ],
    consumes: [
      'application/json',
    ],
    schemes: ['http', 'https'],
    paths: {},
    tags: ['account', 'auth', 'location'],
    components: {
      securitySchemes: {
        jwtAuth: {
          type: 'apiKey',
          description: 'Use your token here',
          in: 'header',
          name: 'authorization',
        },
      },
    },
    security: [
      {
        jwtAuth: [],
      },
    ],
  };

  const options = (fileName) => ({
    // import swaggerDefinitions
    swaggerDefinition,
    // path to the API docs
    apis: [fileName],
  });

  application.use(getResponseExpress(application, options(__filename), swaggerSpecPath));

oneEyedSunday avatar Aug 11 '22 01:08 oneEyedSunday