Skip to content

Commit da49e9e

Browse files
committed
refactor(core): ensure that post-processors only process what is needed
1 parent fa38e75 commit da49e9e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

springwolf-core/src/main/java/io/github/springwolf/core/asyncapi/schemas/SwaggerSchemaService.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,14 @@ public String getSimpleNameFromType(Type type) {
226226

227227
private void postProcessSchemas(
228228
Map<String, Schema> schemasToProcess, Map<String, Schema> schemas, String contentType) {
229-
boolean schemasHadEntries = !schemas.isEmpty();
230229
for (SchemasPostProcessor processor : schemaPostProcessors) {
231230
for (Schema schema : schemasToProcess.values()) {
232-
processor.process(schema, schemas, contentType);
233-
234-
if (schemasHadEntries && !schemas.containsValue(schema)) {
235-
// If the post-processor removed the schema, we can stop processing
236-
break;
231+
if (!schemas.containsValue(schema)) {
232+
// If the post-processor removed the schema, we can skip it
233+
continue;
237234
}
235+
236+
processor.process(schema, schemas, contentType);
238237
}
239238
}
240239
}

0 commit comments

Comments
 (0)