Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit b087a90

Browse files
author
Sebastien Blanchard
committed
Allow $ in parameter names to document feather.js $limit, $sort parameters
1 parent a12de92 commit b087a90

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/parsers/api_param.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var regExp = {
3636
},
3737
wName: {
3838
b: '(\\[?\\s*', // 5 optional optional-marker
39-
name: '([a-zA-Z0-9\\:\\.\\/\\\\_-]+', // 6
39+
name: '([a-zA-Z0-9\\$\\:\\.\\/\\\\_-]+', // 6
4040
withArray: '(?:\\[[a-zA-Z0-9\\.\\/\\\\_-]*\\])?)', // https://github.com/apidoc/apidoc-core/pull/4
4141
oDefaultValue: { // optional defaultValue
4242
b: '(?:\\s*=\\s*(?:', // starting with '=', optional surrounding spaces

test/parser_api_param_test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ describe('Parser: apiParam', function() {
4242
description: 'The users name.'
4343
}
4444
},
45+
{
46+
title: '$Simple fieldname only',
47+
content: '$simple',
48+
expected: {
49+
group: 'Parameter',
50+
type: undefined,
51+
size: undefined,
52+
allowedValues: undefined,
53+
optional: false,
54+
field: '$simple',
55+
defaultValue: undefined,
56+
description: ''
57+
}
58+
},
4559
{
4660
title: 'All options, with optional defaultValue',
4761
content: ' ( MyGroup ) { \\Object\\String.uni-code_char[] { 1..10 } = \'abc\', \'def\' } ' +

0 commit comments

Comments
 (0)