1
votes

My application is made by the LoopBack4 framework. In this picture there are three API's are present. I want to use only the login API. So I don't want to visible /users API here. In LoopBack2 and LoopBack3 can do this but how can I hide this Users API from this swagger using LoopBack4.

Any code level configurations?

enter image description here

1

1 Answers

2
votes

LoopBack 4 will hide any Open API Spec 3.0 OperationObject that has x-visibility: undocumented.

This means that on a controller functions' operation decorator, you can write the following:

class UserController {
  @get('/users', {
    'x-visibility': 'undocumented',
    ...
  })
  async getUsers() {...}
}