source: node_modules/swagger-client/es/helpers/get-operation-raw.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 724 bytes
RevLine 
[d24f17c]1import findOperation from './find-operation.js';
2import opId from './op-id.js';
3import idFromPathMethodLegacy from './id-from-path-method/legacy.js';
4export default function getOperationRaw(spec, id) {
5 if (!spec || !spec.paths) {
6 return null;
7 }
8 return findOperation(spec, ({
9 pathName,
10 method,
11 operation
12 }) => {
13 if (!operation || typeof operation !== 'object') {
14 return false;
15 }
16 const rawOperationId = operation.operationId; // straight from the source
17 const operationId = opId(operation, pathName, method);
18 const legacyOperationId = idFromPathMethodLegacy(pathName, method);
19 return [operationId, legacyOperationId, rawOperationId].some(val => val && val === id);
20 });
21}
Note: See TracBrowser for help on using the repository browser.