Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@loopback/openapi-v3
Advanced tools
Decorators that annotate LoopBack artifacts with OpenAPI v3 metadata and utilities that transform LoopBack metadata to OpenAPI v3 specifications
This package contains:
The package has functions described above for LoopBack controller classes. Decorators apply REST api mapping metadata to controller classes and their members. And utilities that inspect controller classes to build OpenAPI 3.0.0 specifications from REST API mapping metadata.
Functions for more artifacts will be added when we need.
npm install --save @loopback/openapi-v3
Currently this package only has spec generator for controllers. It generates
OpenAPI specifications for a given decorated controller class, including
paths
, components.schemas
, and servers
.
Here is an example of calling function getControllerSpec
to generate the
OpenAPI spec:
import {get, getControllerSpec} from '@loopback/openapi-v3';
class MyController {
@get('/greet')
greet() {
return 'Hello world!';
}
}
const myControllerSpec = getControllerSpec(MyController);
then the myControllerSpec
will be:
{
paths: {
'/greet': {
get: {
'x-operation-name': 'greet'
}
}
},
}
For details of how to apply controller decorators, please check http://loopback.io/doc/en/lb4/Decorators.html#route-decorators
See https://www.openapis.org/ and version 3.0.0 of OpenAPI Specification.
Run npm test
from the root folder.
See all contributors.
MIT
FAQs
Decorators that annotate LoopBack artifacts with OpenAPI v3 metadata and utilities that transform LoopBack metadata to OpenAPI v3 specifications
The npm package @loopback/openapi-v3 receives a total of 27,051 weekly downloads. As such, @loopback/openapi-v3 popularity was classified as popular.
We found that @loopback/openapi-v3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.