Skip to content

Instantly share code, notes, and snippets.

View alexanderosipov's full-sized avatar

Alexander Osipov alexanderosipov

View GitHub Profile
@alexanderosipov
alexanderosipov / api.raml
Created September 24, 2015 09:52
atom crashes
#%RAML 0.8
title: New API
version: v1
mediaType: application/json
baseUri: http://samplehost.com
schemas:
- www: !include schemas/www.json
- www-xml: !include schemas/www.xml
traits:
- zzz:
it('remove all attributes and add #aa81', function () {
var api = util.loadApi(util.data('attr/aa8.raml'));
var method: hl.IHighLevelNode = <hl.IHighLevelNode>util.xpath(api, "resources[0]/methods[0]");
var attrs = method.attributes('protocols');
console.log("Original:\n" + api.lowLevel().unit().contents());
attrs.forEach(attr => attr.remove());
console.log("After remove:\n" + api.lowLevel().unit().contents());
['HTTP', 'HTTPS', 'HUE'].forEach(val => method.attrOrCreate('protocols').addValue(val));
console.log("After insert:\n" + api.lowLevel().unit().contents());
console.log('attributes count: ' + method.attributes('protocols').length); // 4
@alexanderosipov
alexanderosipov / affirmation
Created December 17, 2015 11:54
MuleSoft Contributor Agreement Acceptance by Alexander Osipov
I, Alexander Osipov, have read and do accept the MuleSoft Contributor Agreement
at http://www.mulesoft.org/legal/contributor-agreement.html
Accepted on Thu Dec 17 2015 17:54:06 GMT+0600 (Russia TZ 5 Standard Time)