Skip to content

Commit

Permalink
Add resolveResponses flag to ParseOptions and OperationProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
micryc committed Oct 15, 2024
1 parent 0ab2e8a commit a027b2e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ParseOptions {
private boolean validateInternalRefs = true;
private boolean legacyYamlDeserialization = false;
private boolean resolveRequestBody = false;

private boolean resolveResponses = false;
private boolean oaiAuthor;
private boolean inferSchemaType = true;
private boolean safelyResolveURL;
Expand Down Expand Up @@ -161,4 +161,12 @@ public List<String> getRemoteRefBlockList() {
public void setRemoteRefBlockList(List<String> remoteRefBlockList) {
this.remoteRefBlockList = remoteRefBlockList;
}

public boolean isResolveResponses() {
return resolveResponses;
}

public void setResolveResponses(boolean resolveResponses) {
this.resolveResponses = resolveResponses;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void processOperation(Operation operation) {
ApiResponse response = responses.get(responseCode);
if(response != null) {
//This part allows parser to put response inline without the resolveFully option set to true
if (response.get$ref() != null) {
if (response.get$ref() != null && cache != null && cache.getParseOptions() != null && cache.getParseOptions().isResolveResponses()) {

responseProcessor.processResponse(response);

Expand Down

0 comments on commit a027b2e

Please sign in to comment.