mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
## Summary Resolves [#1292](https://github.com/elastic/kibana-team/issues/1292) ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
This commit is contained in:
parent
02e9ee48c3
commit
841d052776
2 changed files with 3 additions and 1 deletions
|
@ -117,10 +117,12 @@ describe('assignToPaths', () => {
|
|||
assignToPaths(paths, '/foo', {});
|
||||
assignToPaths(paths, '/bar/{id?}', {});
|
||||
assignToPaths(paths, '/bar/file/{path*}', {});
|
||||
assignToPaths(paths, '/bar/file/{path*}/{id?}', {});
|
||||
expect(paths).toEqual({
|
||||
'/foo': {},
|
||||
'/bar/{id}': {},
|
||||
'/bar/file/{path}': {},
|
||||
'/bar/file/{path}/{id}': {},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -132,7 +132,7 @@ export const assignToPaths = (
|
|||
path: string,
|
||||
pathObject: OpenAPIV3.PathItemObject
|
||||
): void => {
|
||||
const pathName = path.replace(/[\?\*]/, '');
|
||||
const pathName = path.replace(/[\?\*]/g, '');
|
||||
paths[pathName] = { ...paths[pathName], ...pathObject };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue