Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
bi-service-doc
Advanced tools
This bi-service
plugin generates documentation (swagger-ui
like frontend) for bi-service
Apps.
Here is how it works in few steps:
App
s are fetched from AppManager
App
in AppManager
, corresponding (additional) Doc
http app (which serves the documentation frontend) is created and pushed into internal AppManager
stackDoc
http apps implement the same interface of generic http App
object, the service initialization process continues as it would without any documentation being generated.index.js
file:const config = require('bi-config');
const Service = require('bi-service');
//service initialization stuff...
const service = new Service(config);
//...
//hook-up the plugin
require('bi-service-doc');
config.json5
:{
apps: {
appName: {
// provide the doc configuration section for each app you want
// the documentation to be generated for
doc: {
baseUrl: 'http://127.0.0.1:3000',
listen: 3000,
title: 'User API', //optional
stopOnError: true, //optional
//allows us to include hand-crafted API description for each version
readme: { //optional
'v2.0': 'lib/routes/v2.0/README.md'
}
}
}
}
}
desc
& summary
constructor options.content-type(s)
as defined via route.acceptsContentTypeAjv
keyword $desc
which bi-service
provides, can be used to describe individual request/response data properties in user defined Route
validation schemas.
route.respondsWith({ //200 - OK response
type: 'object',
properties: {
is_active: {
type: 'boolean',
$desc: 'Whether the user has been online within a period of last 7 days'
}
}
});
//
route.validate({
username: {type: 'string'}
}, 'params');
route.respondsWith
method:
route.respondsWith(RequestError);
route.respondsWith(new RequestError({
apiCode: 'tag.alreadyExists'
message: 'Tag already exists'
}));
route.respondsWith(UnauthorizedError);
Also see bi-service
Error management
FAQs
automated API documentation module
The npm package bi-service-doc receives a total of 1 weekly downloads. As such, bi-service-doc popularity was classified as not popular.
We found that bi-service-doc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.