2

I'm using @logisticinfotech/sails-hook-actions2-swagger to document my REST API. My endpoint looks like this: / user /: uid / company /: cid. After generating the documentation, the company crashes between two IDs, which makes the endpoint look like this: / user /: uid /: cid, which can't be left. I can't fire this company to submit via Swagger UI.

My swagger.js:

'PUT /user/:uid/company/:cid':{action: 'userCompany/add',
            swagger: {
              summary: 'Add user to company',
              parameters: [{
                in: 'path',
                name: 'uid',
                required: true,
                type: 'string',
                description: 'User account ID'
              },
              {
                in: 'path',
                name: 'cid',
                required: true,
                type: 'string',
                description: 'Company ID'  
              }]
            }
          },

Anyone has any idea?

Helen
  • 87,344
  • 17
  • 243
  • 314
henry123
  • 17
  • 2

1 Answers1

0

Your url setup should be defined as follows

   'PUT /user/{uid}/company/{cid}'

Then it will properly render the swagger

Edward Romero
  • 2,905
  • 1
  • 5
  • 17