Skip to content

Commit

Permalink
Fix the resource description path splitter (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
childish-sambino authored Jul 8, 2019
1 parent 23f4212 commit 94766aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/services/twilio-api/get-action-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const getSummaryDescription = actionDefinition => {
}

const actionName = actionDefinition.actionName;
const pathParts = actionDefinition.path.replace(/\.json$/, '').replace(/\/{.+?}$/g, '').split('/');
const pathParts = actionDefinition.path.replace(/\.json$/, '').replace(/\/{.+?}/g, '').split('/');
const resourceName = capitalize(pathParts[pathParts.length - 1]);

if (actionName === 'list') {
Expand Down
2 changes: 1 addition & 1 deletion test/services/twilio-api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('services', () => {
description: null
},
actionName: 'fetch',
path: '/Foo/Bar/{BarSid}.json'
path: '/Foo/{Account}/Bar/{BarSid}.json'
});
expect(result).to.equal('fetch a Bar resource');
});
Expand Down

0 comments on commit 94766aa

Please sign in to comment.