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

Function validate

index.js:42–48  ·  view source on GitHub ↗

Checks the source spec is in a format version and protocol we expect to see @param src {aws-spec} the specification to check @returns boolean

(src)

Source from the content-addressed store, hash-verified

40@returns boolean
41*/
42function validate(src){
43 var result = true;
44 var validProtocols = ['json','rest-json','rest-xml','query','ec2'];
45 if ((typeof src.version !== 'undefined') && (src.version != '2.0')) result = false; // seems to be ok if missing
46 if (validProtocols.indexOf(src.metadata.protocol)<0) result = false;
47 return result;
48}
49
50/**
51rename an object property by removing and re-adding it

Callers 1

index.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected