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)
| 40 | @returns boolean |
| 41 | */ |
| 42 | function 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 | /** |
| 51 | rename an object property by removing and re-adding it |