Skip to content

Commit 60bbb9e

Browse files
author
Fabian Köntopp
committed
Fix #8822
1 parent ee9687f commit 60bbb9e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

docs/generators/spring.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl
1111
|additionalModelTypeAnnotations|Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)| |null|
1212
|allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false|
1313
|apiFirst|Generate the API from the OAI spec at server compile time (API first approach)| |false|
14+
|apiNamePrefix|Prefix that will be prepended to all API names ('tags'). Default: empty string. e.g. Test => TestPetApi.| |null|
15+
|apiNameSuffix|Suffix that will be appended to all API names ('tags'). Default: Api. e.g. Pet => PetApi.| |null|
1416
|apiPackage|package for generated api classes| |org.openapitools.api|
1517
|artifactDescription|artifact description in generated pom.xml| |OpenAPI Java|
1618
|artifactId|artifactId in generated pom.xml. This also becomes part of the generated library's filename| |openapi-spring|

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ public String toApiName(String name) {
744744
return "DefaultApi";
745745
}
746746
name = sanitizeName(name);
747-
return camelize(name) + "Api";
747+
return camelize(apiNamePrefix + "_" + name + "_" + apiNameSuffix);
748748
}
749749

750750
@Override

0 commit comments

Comments
 (0)