Skip to content

Add a new decorator @visibility('undocumented') #6392

Description

@bajtos

#1896 added support for a LoopBack-specific OpenAPI metadata allowing API developers to hide an endpoint (an OpenAPI operation) from the spec generated by the server.

{
  "x-visibility": "undocumented"
}

At the moment, developers must use @operation decorator to provide this metadata, decorators like @get and @post cannot be used.

Let's implement a new decorator @visibility to make it easier to add x-visibility metadata to controller methods.

Example use:

class MyController {
  @get('/')
  @visibility('undocumented')
  index() {
     return '<html>Undocumented internal endpoint.</html>';
  }
}

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions