Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when resource does not define method in RAML #8

Closed
cybertk opened this issue Nov 5, 2014 · 0 comments
Closed

Crash when resource does not define method in RAML #8

cybertk opened this issue Nov 5, 2014 · 0 comments

Comments

@cybertk
Copy link
Owner

cybertk commented Nov 5, 2014

Given a raml which contains resource /root has not defined method section,

#%RAML 0.8

title: World Music API
baseUri: http://example.api.com/{version}
version: v1

/root:
  /machines:
    get:
      responses:
        200:
          body:
            application/json:
              schema: |
                [
                  type: 'string'
                  name: 'string'
                ]
              example: |
                { "type": "Kulu", "name": "Mike" }

Abao crashed with

/Users/quanlong/projects/abao/node_modules/async/lib/async.js:120
        if (!arr.length) {
                ^
TypeError: Cannot read property 'length' of undefined
  at Object.async.each (/Users/quanlong/projects/abao/node_modules/async/lib/async.js:120:17)
  at /Users/quanlong/projects/abao/lib/add-tests.js:33:20
  at /Users/quanlong/projects/abao/node_modules/async/lib/async.js:125:13
  at Array.forEach (native)
  at _each (/Users/quanlong/projects/abao/node_modules/async/lib/async.js:46:24)
  at Object.async.each (/Users/quanlong/projects/abao/node_modules/async/lib/async.js:124:9)
  at addTests (/Users/quanlong/projects/abao/lib/add-tests.js:18:18)
  at /Users/quanlong/projects/abao/lib/abao.js:40:18
  at fn (/Users/quanlong/projects/abao/node_modules/async/lib/async.js:641:34)
  at Object._onImmediate (/Users/quanlong/projects/abao/node_modules/async/lib/async.js:557:34)
  at processImmediate [as _immediateCallback] (timers.js:345:15)
@cybertk cybertk closed this as completed in 846014b Nov 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant