In case you don't have Node.js installed locally use NVM:
$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash $ nvm install v0.12.2 $ nvm use v0.12.2 $ nvm alias default v0.12.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ npm install -g curl-trace-parser | |
$ brew install --HEAD \ | |
https://raw.github.com/apiaryio/snowcrash/master/tools/homebrew/snowcrash.rb | |
$ curl --trace - --header "Content-Type: application/json" \ | |
--request POST \ | |
--data-binary "{ \"product\":\"1AB23ORM\", \"quantity\": 2 }" \ | |
"http://curltraceparser.apiary.io/shopping-cart" \ | |
| curl-trace-parser --blueprint \ | |
| snowcrash | |
name: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hooks = require('hooks'); | |
// Recursively add null as acceptable type if there is string | |
// "#nullable" present in the property description | |
var patchPropertiesWithNullable = function(schema) { | |
if (typeof(schema['properties']) == 'object' && ! Array.isArray(schema['properties'])){ | |
for (property in schema['properties']){ | |
var partialSchemaToPatch = schema['properties'][property]; | |
schema['properties'][property] = patchPropertiesWithNullable(partialSchemaToPatch); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- 0.8 | |
- 0.10 | |
before_install: | |
- npm install -g dredd | |
script: ./scripts/test | |
notifications: | |
email: | |
recipients: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
./node_modules/coffee-script/bin/coffee app.coffee & | |
sleep 1 | |
PID=$! | |
dredd apiary.apib http://localhost:3000/ | |
RESULT=$? | |
kill -9 $PID | |
exit $RESULT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
./node_modules/coffee-script/bin/coffee app.coffee & | |
sleep 5 | |
PID=$! | |
dredd apiary.apib http://localhost:3000/ | |
RESULT=$? | |
kill -9 $PID | |
exit $RESULT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: node_js | |
node_js: | |
- 0.8 | |
- 0.10 | |
before_install: | |
- npm install -g dredd | |
script: ./scripts/test | |
services: | |
- mongodb | |
before_script: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kolotoc:~ netmilk$ git clone git://github.com/apiaryio/snowcrash.git | |
Cloning into 'snowcrash'... | |
remote: Counting objects: 2090, done. | |
remote: Compressing objects: 100% (702/702), done. | |
remote: Total 2090 (delta 1434), reused 1965 (delta 1311) | |
Receiving objects: 100% (2090/2090), 951.94 KiB | 700.00 KiB/s, done. | |
Resolving deltas: 100% (1434/1434), done. | |
Checking connectivity... done | |
kolotoc:~ netmilk$ cd snowcrash | |
kolotoc:snowcrash netmilk$ git submodule update --init --recursive |