Skip to content

Commit

Permalink
Merge pull request #3560 from kliushnichenko/fix/openapi-app-name
Browse files Browse the repository at this point in the history
fix misleading openapi application name
  • Loading branch information
jknack authored Oct 17, 2024
2 parents ac21d02 + 70d20ee commit badd7ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions jooby/src/main/java/io/jooby/OpenAPIModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,11 @@ public OpenAPIModule() {
public void install(@NonNull Jooby application) throws Exception {
String dir = Optional.ofNullable(application.getBasePackage()).orElse("/").replace(".", "/");

String appname = application.getName().replace("Jooby", "openapi").replace("Kooby", "openapi");
String appName = application.getClass().getSimpleName()
.replace("Jooby", "openapi")
.replace("Kooby", "openapi");
for (Format ext : format) {
String filename = String.format("/%s.%s", appname, ext.name().toLowerCase());
String filename = String.format("/%s.%s", appName, ext.name().toLowerCase());
String openAPIFileLocation = Router.normalizePath(dir) + filename;
application.assets(
fullPath(openAPIPath, "/openapi." + ext.name().toLowerCase()), openAPIFileLocation);
Expand Down

0 comments on commit badd7ae

Please sign in to comment.