forked from loafle/openapi-generator-original
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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user