Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class ParseOptions {
private boolean flattenComposedSchemas;
private boolean camelCaseFlattenNaming;
private boolean skipMatches;
private boolean allowEmptyStrings = true;

public boolean isResolve() {
return resolve;
Expand Down Expand Up @@ -59,4 +60,12 @@ public boolean isCamelCaseFlattenNaming() {
public void setCamelCaseFlattenNaming(boolean camelCaseFlattenNaming) {
this.camelCaseFlattenNaming = camelCaseFlattenNaming;
}

public boolean isAllowEmptyString() {
return allowEmptyStrings;
}

public void setAllowEmptyString(boolean allowEmptyStrings) {
this.allowEmptyStrings = allowEmptyStrings;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ public SwaggerParseResult readWithInfo(String path, JsonNode node) {
}

public SwaggerParseResult parseJsonNode(String path, JsonNode node) {
return new OpenAPIDeserializer().deserialize(node, path);
return new OpenAPIDeserializer().deserialize(node, path,new ParseOptions());
}
public SwaggerParseResult parseJsonNode(String path, JsonNode node, ParseOptions options) {
return new OpenAPIDeserializer().deserialize(node, path, options);
}

public SwaggerParseResult readContents(String yaml) {
Expand All @@ -149,7 +152,12 @@ private SwaggerParseResult readContents(String swaggerAsString, List<Authorizati
try {
final ObjectMapper mapper = getRightMapper(swaggerAsString);
final JsonNode rootNode = mapper.readTree(swaggerAsString);
final SwaggerParseResult result = parseJsonNode(location, rootNode);
final SwaggerParseResult result;
if (options != null) {
result = parseJsonNode(location, rootNode, options);
}else {
result = parseJsonNode(location, rootNode);
}
if (result.getOpenAPI() != null) {
return resolve(result, auth, options, location);
}
Expand Down
Loading