Skip to content

Commit b909a97

Browse files
committed
Fix for issue 922
1 parent 9081c3e commit b909a97

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/util/OpenAPIDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2152,7 +2152,6 @@ public Schema getSchema(ObjectNode node, String location, ParseResult result){
21522152
}
21532153

21542154
value = getString("default", node, false, location, result);
2155-
schema.setDefault(false);
21562155
if (StringUtils.isNotBlank(value)) {
21572156
schema.setDefault(value);
21582157
}
@@ -2197,6 +2196,7 @@ public Schema getSchema(ObjectNode node, String location, ParseResult result){
21972196
}
21982197

21992198
bool = getBoolean("deprecated", node, false, location, result);
2199+
schema.setDeprecated(false);
22002200
if(bool != null){
22012201
schema.setDeprecated(bool);
22022202
}

modules/swagger-parser/src/test/java/io/swagger/parser/OpenAPIParserTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ public void testSample() {
465465
ParseOptions options = new ParseOptions();
466466
OpenAPI openAPI = openAPIParser.readLocation("petstore.json",null,null).getOpenAPI();
467467
assertNotNull(openAPI);
468-
assertEquals(openAPI.getComponents().getSchemas().get("Pet").getDefault(),Boolean.FALSE);
468+
assertEquals(openAPI.getComponents().getSchemas().get("Pet").getDeprecated(),Boolean.FALSE);
469469

470470
}
471471

0 commit comments

Comments
 (0)