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

Function attachOperation

index.js:786–817  ·  view source on GitHub ↗
(paths, url, method, action, signatureVersion)

Source from the content-addressed store, hash-verified

784// This assumes there are no conflicts, and will overwrite existing
785// actions, so that should be checked first
786function attachOperation(paths, url, method, action, signatureVersion) {
787 if (paths[url]) {
788 paths[url][method] = action;
789 return;
790 }
791
792 paths[url] = { [method]: action };
793 if (signatureVersion === 4) {
794 paths[url].parameters = [];
795 for (var h in amzHeaders) {
796 var param = {};
797 param["$ref"] = '#/components/parameters/'+amzHeaders[h];
798 paths[url].parameters.push(param);
799 }
800 }
801 else if (signatureVersion === 3) {
802 paths[url].parameters = [];
803 for (var h in s3Headers) {
804 var param = {};
805 param["$ref"] = '#/components/parameters/'+s3Headers[h];
806 paths[url].parameters.push(param);
807 }
808 }
809 else if (signatureVersion === 2) {
810 paths[url].parameters = [];
811 for (var p in v2Params) {
812 var param = {};
813 param["$ref"] = '#/components/parameters/'+v2Params[p];
814 paths[url].parameters.push(param);
815 }
816 }
817}
818
819module.exports = {
820

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected