Closed mohammadp007 closed 4 years ago
You configured your own swagger.html file to be used. So in this file the json to load has to be configured correctly.
You have not configured a docsJsonPath so the docsPath should be the url used in the SwaggerUIBundle initialization.
You configured your own swagger.html file to be used. So in this file the json to load has to be configured correctly.
You have not configured a docsJsonPath so the docsPath should be the url used in the SwaggerUIBundle initialization.
What url I should use?
For your posted config it should be '/swagger'
For your posted config it should be '/swagger'
Thank you so much, the problem solved
I have setup swagger and my problem is that at first when I load the page it shows me "No API definition provided." but when I hit Explore button it shows up the documents correctly. below is my configurations: App.js
const app = express(feathers()) .configure(swagger({ docsPath: '/swagger', uiIndex: path.join(__dirname, '../public/swagger.html'), idType: 'string', specs: { info: { title: 'Todo back-end', description: 'Todo app api', version: '1.0.0', }, }, }));
and this is one of my services as an example:
lists.docs = { definitions: { event: List, //import your own library, use the 'Model' object in this file. 'lists_list': { //this library currently configures the return documentation to look for ``${tag} list
type: 'array', items: { $ref: '#/definitions/lists_list' } }, 'lists': { type: 'object', properties: { cards: { type: 'object', description: 'list of cards' }, title: { type: 'string', description: 'title of the list' }, }, items: { $ref: '#/definitions/lists' } } } };`