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

Allow $ in parameter names #36

Merged
merged 1 commit into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/parsers/api_param.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var regExp = {
},
wName: {
b: '(\\[?\\s*', // 5 optional optional-marker
name: '([a-zA-Z0-9\\:\\.\\/\\\\_-]+', // 6
name: '([a-zA-Z0-9\\$\\:\\.\\/\\\\_-]+', // 6
withArray: '(?:\\[[a-zA-Z0-9\\.\\/\\\\_-]*\\])?)', // https://github.com/apidoc/apidoc-core/pull/4
oDefaultValue: { // optional defaultValue
b: '(?:\\s*=\\s*(?:', // starting with '=', optional surrounding spaces
Expand Down
14 changes: 14 additions & 0 deletions test/parser_api_param_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,20 @@ describe('Parser: apiParam', function() {
description: 'The users name.'
}
},
{
title: '$Simple fieldname only',
content: '$simple',
expected: {
group: 'Parameter',
type: undefined,
size: undefined,
allowedValues: undefined,
optional: false,
field: '$simple',
defaultValue: undefined,
description: ''
}
},
{
title: 'All options, with optional defaultValue',
content: ' ( MyGroup ) { \\Object\\String.uni-code_char[] { 1..10 } = \'abc\', \'def\' } ' +
Expand Down