Allow useInlineModelResolver to be influenced by generator options (#13056)

* Move logic so that it can dynamically be influenced by opts

* Or should it be here?

* We handle the useInlineModelResolver logic in configureGeneratorProperties after processOpts

Co-authored-by: Westerlaken, H.L. (Laurens) <laurens.westerlaken@devolksbank.nl>
This commit is contained in:
Laurens-W
2022-08-09 01:04:13 +02:00
committed by GitHub
parent 9610a81a13
commit 9a04113258

View File

@@ -254,6 +254,15 @@ public class DefaultGenerator implements Generator {
}
config.processOpts();
// resolve inline models
if (config.getUseInlineModelResolver()) {
InlineModelResolver inlineModelResolver = new InlineModelResolver();
inlineModelResolver.setInlineSchemaNameMapping(config.inlineSchemaNameMapping());
inlineModelResolver.setInlineSchemaNameDefaults(config.inlineSchemaNameDefault());
inlineModelResolver.flatten(openAPI);
}
config.preprocessOpenAPI(openAPI);
// set OpenAPI to make these available to all methods
@@ -889,14 +898,6 @@ public class DefaultGenerator implements Generator {
}
}
// resolve inline models
if (config.getUseInlineModelResolver()) {
InlineModelResolver inlineModelResolver = new InlineModelResolver();
inlineModelResolver.setInlineSchemaNameMapping(config.inlineSchemaNameMapping());
inlineModelResolver.setInlineSchemaNameDefaults(config.inlineSchemaNameDefault());
inlineModelResolver.flatten(openAPI);
}
configureGeneratorProperties();
configureOpenAPIInfo();