Skip to content

Commit e46b847

Browse files
mma5997frantuma
authored andcommitted
Fixed indentation
needed to use spaces instead of tabs and correct indentation
1 parent c4f744d commit e46b847

File tree

4 files changed

+29
-24
lines changed

4 files changed

+29
-24
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,17 @@ public void setResolveFully(boolean resolveFully) {
3939
}
4040

4141
public boolean isResolveRequestBody() {
42-
return resolveRequestBody;
43-
}
44-
42+
return resolveRequestBody;
43+
}
44+
4545
/**
46-
* If set to true, will help resolving the requestBody as inline, provided resolve is also set to true.
47-
* Default is false because of the existing behaviour.
46+
* If set to true, will help resolving the requestBody as inline, provided
47+
* resolve is also set to true. Default is false because of the existing
48+
* behaviour.
4849
*/
49-
public void setResolveRequestBody(boolean resolveRequestBody) {
50-
this.resolveRequestBody = resolveRequestBody;
51-
}
50+
public void setResolveRequestBody(boolean resolveRequestBody) {
51+
this.resolveRequestBody = resolveRequestBody;
52+
}
5253

5354
public boolean isFlatten() { return flatten; }
5455

modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/ResolverCache.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ public class ResolverCache {
7171
private final ParseOptions parseOptions;
7272

7373

74-
/*
75-
a map that stores original external references, and their associated renamed references
74+
/*
75+
* a map that stores original external references, and their associated renamed
76+
* references
7677
*/
7778
private Map<String, String> renameCache = new HashMap<>();
7879

@@ -393,8 +394,8 @@ public Map<String, String> getExternalFileCache() {
393394
public Map<String, String> getRenameCache() {
394395
return Collections.unmodifiableMap(renameCache);
395396
}
396-
397+
397398
public ParseOptions getParseOptions() {
398-
return parseOptions;
399-
}
399+
return parseOptions;
400+
}
400401
}

modules/swagger-parser-v3/src/main/java/io/swagger/v3/parser/processors/OperationProcessor.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,24 @@ public void processOperation(Operation operation) {
3939
if(processedOperationParameters != null) {
4040
operation.setParameters(processedOperationParameters);
4141
}
42+
4243
RequestBody requestBody = operation.getRequestBody();
43-
if(requestBody != null) {
44-
//This part allows paser to put requestBody inline without the resolveFully option set to true
45-
if (requestBody.get$ref() != null && cache != null && cache.getParseOptions() != null && cache.getParseOptions().isResolveRequestBody()) {
46-
requestBodyProcessor.processRequestBody(requestBody);
47-
RefFormat refFormat = computeRefFormat(requestBody.get$ref());
48-
RequestBody resolvedRequestBody = cache.loadRef(requestBody.get$ref(), refFormat, RequestBody.class);
44+
if (requestBody != null) {
45+
// This part allows paser to put requestBody inline without the resolveFully
46+
// option set to true
47+
if (requestBody.get$ref() != null && cache != null && cache.getParseOptions() != null && cache.getParseOptions().isResolveRequestBody()) {
48+
requestBodyProcessor.processRequestBody(requestBody);
49+
RefFormat refFormat = computeRefFormat(requestBody.get$ref());
50+
RequestBody resolvedRequestBody = cache.loadRef(requestBody.get$ref(), refFormat, RequestBody.class);
4951

5052
if (resolvedRequestBody != null) {
51-
requestBody = resolvedRequestBody;
52-
operation.setRequestBody(resolvedRequestBody);
53+
requestBody = resolvedRequestBody;
54+
operation.setRequestBody(resolvedRequestBody);
5355
}
54-
}
56+
}
5557
requestBodyProcessor.processRequestBody(requestBody);
5658
}
5759

58-
5960
final Map<String, ApiResponse> responses = operation.getResponses();
6061
if (responses != null) {
6162
for (String responseCode : responses.keySet()) {

modules/swagger-parser-v3/src/test/resources/issue-1706/SimpleRequestResponseRef.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282
}
8383
}
8484
},
85-
"schemas": {}
85+
"schemas": {
86+
87+
}
8688
}
8789
}

0 commit comments

Comments
 (0)