Skip to content

Commit

Permalink
fix(schema): do not recurse endlessly when writing cyclic schemas
Browse files Browse the repository at this point in the history
the schema writer will now load the original schema file from disk, so that only minimal changes
will get made

fixes #185 for good
  • Loading branch information
trieloff committed Jan 8, 2020
1 parent 1633739 commit 297f0d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ npm-debug.log
# instanbul code coverage…
coverage
/examples/tmp-docs
.nyc_output
.nyc_output
test/fixtures/cyclic-out/
2 changes: 1 addition & 1 deletion lib/writeSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function writeSchema({ schemadir, origindir }) {
const dirname = path.dirname(filename);


const out = Object.assign({}, schema);
const out = fs.readJSONSync(schema[s.filename]);
if (schema[s.meta] && schema[s.meta].description) {
// copy description from external file
out.description = schema[s.meta].description;
Expand Down

0 comments on commit 297f0d5

Please sign in to comment.