Skip to content

Commit dc35b01

Browse files
committed
set validate internal ref option to true by default
1 parent 6be7be5 commit dc35b01

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

modules/swagger-parser-core/src/main/java/io/swagger/v3/parser/core/models/ParseOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public class ParseOptions {
1010
private boolean skipMatches;
1111
private boolean allowEmptyStrings = true;
1212
private boolean validateExternalRefs = false;
13-
private boolean validateInternalRefs = false;
13+
private boolean validateInternalRefs = true;
1414
private boolean legacyYamlDeserialization = false;
1515

1616
public boolean isResolve() {

modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/OpenAPIV3ParserTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public class OpenAPIV3ParserTest {
8888
@Test
8989
public void testIssue1643_True() throws Exception{
9090
ParseOptions options = new ParseOptions();
91-
options.setValidateInternalRefs(true);
9291
String issue1643 = "openapi: \"3.0.0\"\n" +
9392
"info:\n" +
9493
" version: 1.0.0\n" +
@@ -132,6 +131,7 @@ public void testIssue1643_True() throws Exception{
132131
@Test
133132
public void testIssue1643_False() throws Exception{
134133
ParseOptions options = new ParseOptions();
134+
options.setValidateInternalRefs(false);
135135
String issue1643 = "openapi: \"3.0.0\"\n" +
136136
"info:\n" +
137137
" version: 1.0.0\n" +
@@ -370,6 +370,7 @@ public void testCantReadDeepProperties() {
370370
OpenAPIV3Parser parser = new OpenAPIV3Parser();
371371
ParseOptions options = new ParseOptions();
372372
options.setResolveFully(true);
373+
options.setValidateInternalRefs(false);
373374

374375
final SwaggerParseResult parseResult = parser.readLocation("src/test/resources/cant-read-deep-properties.yaml", null, options);
375376
assertEquals(parseResult.getMessages().size(), 0);
@@ -2552,6 +2553,7 @@ public void testIssue915() {
25522553
public void testIssue931() {
25532554
ParseOptions options = new ParseOptions();
25542555
options.setResolve(true);
2556+
options.setValidateInternalRefs(false);
25552557
SwaggerParseResult result = new OpenAPIV3Parser().readLocation("Issue_931.json", null, options);
25562558
assertNotNull(result.getOpenAPI());
25572559
assertTrue(result.getMessages().size() > 0);

0 commit comments

Comments
 (0)