forked from loafle/openapi-generator-original
Add postProcess method to show donation message (#8142)
* add postProcess method to show donation message * update comment
This commit is contained in:
parent
f766735d5c
commit
49f55b0d8e
@ -182,6 +182,8 @@ public interface CodegenConfig {
|
||||
|
||||
Map<String, Object> updateAllModels(Map<String, Object> objs);
|
||||
|
||||
void postProcess();
|
||||
|
||||
Map<String, Object> postProcessAllModels(Map<String, Object> objs);
|
||||
|
||||
Map<String, Object> postProcessModels(Map<String, Object> objs);
|
||||
|
@ -747,6 +747,16 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
ModelUtils.setDisallowAdditionalPropertiesIfNotPresent(getDisallowAdditionalPropertiesIfNotPresent());
|
||||
}
|
||||
|
||||
// override with any message to be shown right before the process finishes
|
||||
@SuppressWarnings("static-method")
|
||||
public void postProcess() {
|
||||
System.out.println("################################################################################");
|
||||
System.out.println("# Thanks for using OpenAPI Generator. #");
|
||||
System.out.println("# Please consider donation to help us maintain this project \uD83D\uDE4F #");
|
||||
System.out.println("# https://opencollective.com/openapi_generator/donate #");
|
||||
System.out.println("################################################################################");
|
||||
}
|
||||
|
||||
// override with any special post-processing
|
||||
@SuppressWarnings("static-method")
|
||||
public Map<String, Object> postProcessOperationsWithModels(Map<String, Object> objs, List<Object> allModels) {
|
||||
|
@ -925,6 +925,9 @@ public class DefaultGenerator implements Generator {
|
||||
}
|
||||
}
|
||||
|
||||
// post-process
|
||||
config.postProcess();
|
||||
|
||||
// reset GlobalSettings, so that the running thread can be reused for another generator-run
|
||||
GlobalSettings.reset();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user