Skip to content

Commit 6bb96f9

Browse files
mma5997frantuma
authored andcommitted
Fixed #1706
This makes the request body inline so that flatten will pick the next task of making a local reference for the inline schema.
1 parent 1551fed commit 6bb96f9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ public void processOperation(Operation operation) {
4242
}
4343
final RequestBody requestBody = operation.getRequestBody();
4444
if(requestBody != null) {
45+
//This part allows paser to put requestBody schema inline without the resolveFully option set to true
46+
if (requestBody.get$ref() != null) {
47+
requestBodyProcessor.processRequestBody(requestBody);
48+
RefFormat refFormat = computeRefFormat(requestBody.get$ref());
49+
RequestBody resolvedRequestBody = cache.loadRef(requestBody.get$ref(), refFormat, RequestBody.class);
50+
51+
if (resolvedRequestBody != null) {
52+
requestBody = resolvedRequestBody;
53+
operation.setRequestBody(resolvedRequestBody);
54+
}
55+
}
4556
requestBodyProcessor.processRequestBody(requestBody);
4657
}
4758

0 commit comments

Comments
 (0)