MCPcopy Create free account
hub / github.com/APIs-guru/aws2openapi / doit

Function doit

index.js:542–559  ·  view source on GitHub ↗
(methodUri,op,pi)

Source from the content-addressed store, hash-verified

540}
541
542function doit(methodUri,op,pi) {
543 methodUri.replace(/(\{.+?\})/g,function(match,group1){
544 let name = match.replace('{','').replace('}','');
545 let param = (op.parameters||[]).concat(pi.parameters||[]).find(function(e,i,a){
546 return ((e.name == name) && (e.in == 'path'));
547 });
548 if (!param) {
549 //console.warn('Missing path parameter '+match);
550 let nparam = {};
551 nparam.name = name;
552 nparam.in = 'path';
553 nparam.required = true;
554 nparam.schema = { type: 'string' };
555 op.parameters.push(nparam); // correct for missing path parameters (2?)
556 }
557 return match;
558 });
559}
560
561function fillInMissingPathParameters(openapi) {
562 for (let p in openapi.paths) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected