Releases: BlueOakJS/blueoak-server
Add support for configuring HTTP Server Timeout Values
See: https://nodejs.org/api/http.html#http_class_http_server
In particular, support added for:
timeout
(available when running Node v0.9.12 and later)keepAliveTimeout
(available when running Node v8.0.0 and later)headersTimeout
(available when running Node v11.3.0 and later)
These can be set in the "express"
block in default.json
as:
"express": {
"httpServer": {
"timeout": 111111,
"keepAliveTimeout": 222222,
"headersTimeout": 333333
}
}
This feature is also documented on the Wiki as HTTP Server Timeouts.
Attach "sent body" to Express response object when response model validation is on
When response validation is enabled in any mode, the validated body is attached to the Express response object in a field named sentBody
for use by handlers and/or middleware that are configured to execute after the response is sent.
Updates to resolve security vulnerabilities
lodash
from 3.x to 4.x
request
from 2.85 to 2.88
mocha
to latest
In addition to these updates, Node.js v4 is no longer supported.
User-initiated Swagger (OpenAPI) model validation
This release exposes a new function on the swagger
service, validateObject
.
It also raises response model validation errors/warnings (depending on your config) when "unknown" properties, i.e. properties that are not defined in the spec, are returned in the response.
Compose BlueOak Server Projects into One
Use config option:
"server-provisions": ["node-module-name", ...]
To compose BlueOak Server projects into a single server.
Modules implementing "server-provisions" should implement BlueOak Server services and middleware in directories with those names.
Get started with the BlueOak Server project, use the template.
Full request validation
BOS now validates all request parameters (body, form, header, path, query) before returning a validation error.
(It used to return after the first, which meant users may need to make multiple requests before learning everything that was wrong with their original request. The old behavior can be restored by setting swagger.rejectRequestAfterFirstValidationError
in your config.)
Note also, that it is possible to use middleware loaded from a node module.
OpenAPI $ref Compiler
A feature has been added to help the management of OpenAPI (swagger) spec $ref
s to external files by automatically adding references to them to your main API file's definitions
, responses
, and parameters
properties.
Polymorphic Validation of Swagger Models
The major feature of this release is support for polymorphic swagger models (issue #60).
Learn more on the wiki.
The response model validation support that was added in v2.3.0 has also been updated to support a new level, "fail"
.
Read more about that on the wiki too.
Swagger Response Model Validation
This version adds support for validating response models against the defined Swagger spec for each method.
This is very useful during development and is controlled via the swagger.validateResponseModels
parameter, (learn more)[https://github.com/BlueOakJS/blueoak-server/wiki/Handlers#swagger-model-validation].