Skip to content

Commit

Permalink
fix swagger for gateway/microservices
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Sep 13, 2023
1 parent 514347c commit f1dcb9b
Showing 1 changed file with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
See the License for the specific language governing permissions and
limitations under the License.
-%>
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title><%= baseName %> - Swagger UI</title>
<base href="/swagger-ui/"/>
<base href="/swagger-ui/" />
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
Expand Down Expand Up @@ -91,20 +91,23 @@
urls = (
await Promise.allSettled(
services.map(async service => {
return axios.get(`/services/${service}/management/jhiopenapigroups`, axiosConfig).then(response => {
if (Array.isArray(response.data)) {
return response.data.map(({ group, description }) => ({
name: description,
url: `/services/${service}${baseUrl}/${group}`,
}));
}
return undefined;
}).catch(() => {
return axios
.get(`/services/${service}${baseUrl}`, axiosConfig)
.then(() => [{ url: `/services/${service}${baseUrl}`, name: `${service} (default)` }]);
});
})
return axios
.get(`/services/${service}/management/jhiopenapigroups`, axiosConfig)
.then(response => {
if (Array.isArray(response.data)) {
return response.data.map(({ group, description }) => ({
name: description,
url: `/services/${service}/${baseUrl}/${group}`,
}));
}
return undefined;
})
.catch(() => {
return axios
.get(`/services/${service}/${baseUrl}`, axiosConfig)
.then(() => [{ url: `/services/${service}/${baseUrl}`, name: `${service} (default)` }]);
});
}),
)
)
.filter(settled => settled.status === 'fulfilled')
Expand Down

0 comments on commit f1dcb9b

Please sign in to comment.