docworks-jsdoc2spec
Advanced tools
Comparing version 1.5.3 to 1.5.4
@@ -28,3 +28,3 @@ 'use strict'; | ||
return function (prop) { | ||
return (0, _docworksModel.MessageMember)(prop.name, (0, _jsdocHandlerShared.handleType)(prop.type, find, onError, context), prop.description); | ||
return (0, _docworksModel.MessageMember)(prop.name, (0, _jsdocHandlerShared.handleType)(prop.type, find, onError, context), prop.description, prop.optional); | ||
}; | ||
@@ -31,0 +31,0 @@ }; |
@@ -19,3 +19,3 @@ import {handleMeta, handleType, typeContext, handleDoc} from './jsdoc-handler-shared'; | ||
handleType(prop.type, find, onError, context), | ||
prop.description | ||
prop.description, prop.optional | ||
); | ||
@@ -22,0 +22,0 @@ }; |
{ | ||
"name": "docworks-jsdoc2spec", | ||
"version": "1.5.3", | ||
"version": "1.5.4", | ||
"description": "extractor for jsdoc apis to api spec", | ||
@@ -14,3 +14,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"docworks-model": "^1.5.0", | ||
"docworks-model": "^1.5.4", | ||
"intercept-stdout": "^0.1.2", | ||
@@ -17,0 +17,0 @@ "jsdoc": "3.4.0", |
@@ -38,2 +38,9 @@ | ||
/** | ||
* @typedef MessageWithOptionalMembers | ||
* @memberof aNamespace.ServiceMessages | ||
* @property {string} name is mandatory | ||
* @property {string|number} [age] is optional | ||
*/ | ||
/** | ||
* @member prop | ||
@@ -40,0 +47,0 @@ * @memberof aNamespace.ServiceMessages |
@@ -165,2 +165,22 @@ import runJsDoc from '../lib/jsdoc-runner'; | ||
it.only('should support a optional members of a message', function() { | ||
expect(jsDocRes).to.containSubset({ | ||
services: [ | ||
{ | ||
name: 'ServiceMessages', | ||
messages: [ | ||
{ | ||
name: 'MessageWithOptionalMembers', | ||
members: [ | ||
{name: 'name', type: 'string', doc: 'is mandatory'}, | ||
{name: 'age', type: ['string', 'number'], doc: 'is optional', optional: true} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}); | ||
}); | ||
it('should support messages defined using @typedef namespace~message', function() { | ||
@@ -167,0 +187,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125196
3550
Updateddocworks-model@^1.5.4