feathersjs-ecosystem / feathers-swagger

Add documentation to your FeatherJS services and feed them to Swagger UI.
MIT License
225 stars 63 forks source link

Bug: feathers 4.x compatibility #179

Closed craigharman closed 4 years ago

craigharman commented 4 years ago

I have installed the package and can see the swagger json at /docs, but adding uiIndex: true does not produce the swagger-ui html at /docs.

To Reproduce Fresh install of feathers 4 (using cli). In app.js add:

const swagger = require('feathers-swagger'); 

then during configuration:

// Configure swagger
app.configure(swagger({
  specs: {
    docsPath: '/docs',
    uiIndex: true,
    info: {
      title: 'A test',
      description: 'A description',
      version: '1.0.0',
    },
  }
}));

Expected behavior Going to http://localhost:3030/docs should display Swagger UI

System configuration

Mairu commented 4 years ago

You put the options into the specs property. It has to be:

app.configure(swagger({
  docsPath: '/docs',
  uiIndex: true,
  specs: {
    info: {
      title: 'A test',
      description: 'A description',
      version: '1.0.0',
    },
  }
}));