Skip to content

Commit ab172b6

Browse files
Fixes treating empty parsing results
1 parent e1d40c4 commit ab172b6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/parse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function parseFile (file, options, $refs) {
124124
.then(onParsed, onError);
125125

126126
function onParsed (parser) {
127-
if ((options.continueOnError || !parser.plugin.allowEmpty) && isEmpty(parser.result)) {
127+
if (!parser.plugin.allowEmpty && isEmpty(parser.result)) {
128128
reject(ono.syntax(`Error parsing "${file.url}" as ${parser.plugin.name}. \nParsed value is empty`));
129129
}
130130
else {

test/specs/parsers/parsers.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ describe("References to non-JSON files", () => {
230230
}
231231
});
232232

233-
it("should throw a grouped error if no parser can be matched and fastFail is false", async () => {
233+
it("should throw a grouped error if no parser can be matched and continueOnError is true", async () => {
234234
try {
235235
const parser = new $RefParser();
236236
await parser.dereference(path.rel("specs/parsers/parsers.yaml"), {

test/specs/resolvers/resolvers.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ describe("options.resolve", () => {
159159
}
160160
});
161161

162-
it("should throw a grouped error if no resolver can be matched and fastFail is false", async () => {
162+
it("should throw a grouped error if no resolver can be matched and continueOnError is true", async () => {
163163
const parser = new $RefParser();
164164
try {
165165
await parser.dereference(path.abs("specs/resolvers/resolvers.yaml"), {

0 commit comments

Comments
 (0)