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

Commit

Permalink
Merge pull request #62 from Znarkus/multi_param_type
Browse files Browse the repository at this point in the history
Support multiple param types with |
  • Loading branch information
NicolasCARPi committed Oct 16, 2019
2 parents 23e1586 + f06fd32 commit 3776ebd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parsers/api_param.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var regExp = {
},
oType: { // optional type: {string}
b: '\\s*(?:\\{\\s*', // starting with '{', optional surrounding spaces
type: '([a-zA-Z0-9\(\)#:\\.\\/\\\\\\[\\]_-]+)', // 2
type: '([a-zA-Z0-9\(\)#:\\.\\/\\\\\\[\\]_\|-]+)', // 2
oSize: { // optional size within type: {string{1..4}}
b: '\\s*(?:\\{\\s*', // starting with '{', optional surrounding spaces
size: '(.+?)', // 3
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: 'Type, Fieldname, Description',
content: '{String|String[]} name The users name.',
expected: {
group: 'Parameter',
type: 'String|String[]',
size: undefined,
allowedValues: undefined,
optional: false,
field: 'name',
defaultValue: undefined,
description: 'The users name.'
}
},
{
title: '$Simple fieldname only',
content: '$simple',
Expand Down

0 comments on commit 3776ebd

Please sign in to comment.