grinat / moleculer-auto-openapi

Auto generate openapi(swagger) scheme for molecular
29 stars 20 forks source link

Open API UI not loading #8

Closed sachinda123456 closed 3 years ago

sachinda123456 commented 3 years ago

I need to add Open API to my moleculer project 1) Make new service called openapi.service.js In services list as per the documentation 2) Edit Api gateway file and add open api Route 3) Run molecular in development mode (npm run dev )

Question 1
{sever url} openapi/openapi.json this one working {sever url} openapi/ui this one not working only show loading screen

Whats wrong with this code

const Openapi = require('moleculer-auto-openapi')

module.exports = {
  name: 'openapi',
  mixins: [Openapi],
  settings: {
    // all setting optional
    openapi: {
      info: {
        // about project
        description: 'Foo',
        title: 'Bar'
      },
      tags: [
        // you tags
        { name: 'auth', description: 'My custom name' }
      ],
      components: {
        // you auth
        securitySchemes: {
          myBasicAuth: {
            type: 'http',
            scheme: 'basic'
          }
        }
      }
    }
  }
}
 {
        path: '/api/openapi',
        aliases: {
          'GET /openapi.json': 'openapi.generateDocs', // swagger scheme
          'GET /ui': 'openapi.ui' // ui
        }
      },