Skip to content

Allow $refs to link Objects#22

Merged
philsturgeon merged 1 commit intowework:masterfrom
MikeRalphson:linkrefs
Mar 14, 2018
Merged

Allow $refs to link Objects#22
philsturgeon merged 1 commit intowework:masterfrom
MikeRalphson:linkrefs

Conversation

@MikeRalphson
Copy link
Copy Markdown
Contributor

Have PR'd this rather than applying directly, so a) it can get an approval first, b) we might want more tests and c) because I'm seeing four test failures (unchanged before and after this patch).

  19 passing (83ms)
  4 failing

  1) loadSpec()
       loads yaml specs:
     OpenError: ENOENT: no such file or directory, open '/home/mike/nodejs/speccy/test/samples/openapi.yaml'
      at readSpecFile.then.err (lib/loader.js:70:27)
      at <anonymous>

  2) loadSpec()
       does not resolve references by default:
     OpenError: ENOENT: no such file or directory, open '/home/mike/nodejs/speccy/test/samples/refs/openapi.yaml'
      at readSpecFile.then.err (lib/loader.js:70:27)
      at <anonymous>

  3) loadSpec()
       resolves refs when passed { resolve: true }:
     OpenError: ENOENT: no such file or directory, open '/home/mike/nodejs/speccy/test/samples/refs/openapi.yaml'
      at readSpecFile.then.err (lib/loader.js:70:27)
      at <anonymous>

  4) loadSpec()
       throws ReadError for invalid YAML/JSON:

      AssertionError: expected 'OpenError' to be 'ReadError'
      + expected - actual

      -OpenError
      +ReadError
      
      at Assertion.fail (node_modules/should/cjs/should.js:275:17)
      at Assertion.value (node_modules/should/cjs/should.js:356:19)
      at Context.it (test/loader.test.js:49:34)
      at <anonymous>

@philsturgeon
Copy link
Copy Markdown
Contributor

Ah, yep, that's on me. The .gitignore has some rules in it which speccy does not need, and I didn't remove them. We're missing some spec files that tests need, and they're on my laptop at the office: on the other size of Storm Skylar.

I'll merge this with failing tests, and have a PR ready to sort that out by this evening.

@philsturgeon philsturgeon merged commit b3ff1b5 into wework:master Mar 14, 2018
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

Successfully merging this pull request may close these issues.

2 participants