The `uiDirs` option allows users to provide their own set of directories
with UI files, e.g. to provide a custom swagger-ui fork and a custom
set of style/font overrides:
explorer(app, {
uiDirs: [
path.resolve(__dirname, 'public'),
path.resolve(__dirname, 'node_modules', 'swagger-ui')
]
});
The existing option `swaggerDistRoot` is deprecated now.
Add tests verifying that Swagger docs include model description for
recursively nested references to Models and Arrays of Models in
properties, modelTo and modelThrough relations, accepts,
returns and errors.
Fix bugs discovered along the way.
Add a default "success" response message, the status code is 200 or 204
depending on whether the method returns any data.
Append any error messages as specified in the `errors` property
of method's remoting metadata.
Move the description of operation's return type to the "success"
response message.
Include error message models in the API models.
Accepts/returns arguments allow anonymous object types, e.g.
{ 'arg': 'kvp', type: { 'name': 'string', 'value': 'string' } }
As of this commit, these types are converted to Swagger type 'object'.
Refactor the way how loopback types are converted to swagger data types.
- `modelHelper.LDLPropToSwaggerDataType` is responsible for
producing a valid Swagger Data Type object from LDL object
(be it a property, accepts item or returns item).
- LDLPropToSwaggerDataType picks only fields that are part
of the swagger spec, everything else is excluded from the result.
It's up to the caller to add extra fields like `description`.
- refactor `routeHelper.extendWithType` to accept an additional arg:
the original LDL object. This way it's possible to copy all
type-specific fields to the output object and don't add anything
else.
* upstream/master:
Sort endpoints by letter.
Add syntax highlighting styles & highlight threshold.
Add contribution guidelines
Bump version
Fix how the array of models is iterated
Bump version
Make sure nested/referenced models in array are mapped to swagger
Make sure nested/referenced models are mapped to swagger
Bump version
Newest Swagger UI requires application/x-www-form-urlencoded.
Use `dist` property from swagger-ui package.
Fixed undefined modelClass when using polymorphic relations
Bump version
Fix the type name for a property if model class is used
Conflicts:
lib/model-helper.js
lib/swagger.js
public/css/loopbackStyles.css
Previously, highlighting classes were being added to the DOM but had no CSS
so the user just saw black - a lot of CPU usage for nothing.
These styles now attractively and minimally style resposes so long as
they are below a certain threshold, as well as model schemas.
The highlightSizeThreshold fixes the long hang users would
see when large responses were returned.