forked from loafle/openapi-generator-original
Fix flattenPath() in InlineModelResolver: use List instead of Map (#17579)
* Fix flattenPath() in InlineModelResolver: use List instead of Map Fix for https://github.com/OpenAPITools/openapi-generator/issues/17578 * Update InlineModelResolver.java
This commit is contained in:
parent
76560e34c9
commit
69e72203ae
@ -120,7 +120,7 @@ public class InlineModelResolver {
|
|||||||
|
|
||||||
for (Map.Entry<String, PathItem> pathsEntry : paths.entrySet()) {
|
for (Map.Entry<String, PathItem> pathsEntry : paths.entrySet()) {
|
||||||
PathItem path = pathsEntry.getValue();
|
PathItem path = pathsEntry.getValue();
|
||||||
Map<HttpMethod, Operation> operationsMap = new LinkedHashMap<>(path.readOperationsMap());
|
List<Map.Entry<HttpMethod, Operation>> toFlatten = new ArrayList<>(path.readOperationsMap().entrySet());
|
||||||
|
|
||||||
// use path name (e.g. /foo/bar) and HTTP verb to come up with a name
|
// use path name (e.g. /foo/bar) and HTTP verb to come up with a name
|
||||||
// in case operationId is not defined later in other methods
|
// in case operationId is not defined later in other methods
|
||||||
@ -135,13 +135,13 @@ public class InlineModelResolver {
|
|||||||
Callback callback = callbackEntry.getValue();
|
Callback callback = callbackEntry.getValue();
|
||||||
for (Map.Entry<String, PathItem> pathItemEntry : callback.entrySet()) {
|
for (Map.Entry<String, PathItem> pathItemEntry : callback.entrySet()) {
|
||||||
PathItem pathItem = pathItemEntry.getValue();
|
PathItem pathItem = pathItemEntry.getValue();
|
||||||
operationsMap.putAll(pathItem.readOperationsMap());
|
toFlatten.addAll(pathItem.readOperationsMap().entrySet());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Map.Entry<HttpMethod, Operation> operationEntry : operationsMap.entrySet()) {
|
for (Map.Entry<HttpMethod, Operation> operationEntry : toFlatten) {
|
||||||
Operation operation = operationEntry.getValue();
|
Operation operation = operationEntry.getValue();
|
||||||
String inlineSchemaName = this.getInlineSchemaName(operationEntry.getKey(), pathname);
|
String inlineSchemaName = this.getInlineSchemaName(operationEntry.getKey(), pathname);
|
||||||
flattenRequestBody(inlineSchemaName, operation);
|
flattenRequestBody(inlineSchemaName, operation);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user