Skip to content

Commit af03107

Browse files
committed
more updates, fixed code to return correct swagger 3.0 doc
1 parent 2a7948f commit af03107

File tree

2 files changed

+1811
-1792
lines changed

2 files changed

+1811
-1792
lines changed

app/controllers/Application.scala

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,30 +57,25 @@ class Application @Inject() (files: FileService, collections: CollectionService,
5757
// comment
5858
line + "\n"
5959
} else {
60-
if (skipit && !line.startsWith(" ")) {
60+
if (skipit && !(line.startsWith(" ") || line.startsWith("- "))) {
6161
skipit = false
6262
}
6363
if (skipit) {
6464
None
6565
} else if (line.startsWith("info:")) {
6666
skipit = true
6767
"info:\n" +
68-
" version: \"1\"\n" +
6968
" title: " + AppConfiguration.getDisplayName + "\n" +
7069
" description: " + AppConfiguration.getWelcomeMessage + "\n" +
70+
" version: \"" + sys.props.getOrElse("build.version", default = "0.0.0").toString + "\"\n" +
71+
" termsOfService: " + routes.Application.tos().absoluteURL(https) + "\n" +
7172
" contact: " + "\n" +
7273
" name: " + AppConfiguration.getDisplayName + "\n" +
73-
" url: " + routes.Application.email().absoluteURL(https) + "\n" +
74-
" termsOfService: " + routes.Application.tos().absoluteURL(https) + "\n"
75-
} else if (line.startsWith("host:")) {
74+
" url: " + routes.Application.email().absoluteURL(https) + "\n"
75+
} else if (line.startsWith("servers:")) {
7676
skipit = true
77-
"host: " + host + "\n"
78-
} else if (line.startsWith("basePath")) {
79-
skipit = true
80-
"basePath: " + clowderurl.getPath + "/api" + "\n"
81-
} else if (line.startsWith("schemes:")) {
82-
skipit = true
83-
"schemes:\n - " + clowderurl.getProtocol + "\n"
77+
"servers:\n" +
78+
"- url: " + clowderurl + "/api" + "\n"
8479
} else {
8580
line + "\n"
8681
}

0 commit comments

Comments
 (0)