This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 777faec2cc6 CAMEL-22048: camel-platform-http-main - HTTP summary align 
verbs
777faec2cc6 is described below

commit 777faec2cc6648c9889023c89152ef0bfe2572a9
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Mon May 5 16:44:52 2025 +0200

    CAMEL-22048: camel-platform-http-main - HTTP summary align verbs
---
 .../component/platform/http/main/MainHttpServerUtil.java     | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/MainHttpServerUtil.java
 
b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/MainHttpServerUtil.java
index 2b2b53bbcd9..f2565b46ae1 100644
--- 
a/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/MainHttpServerUtil.java
+++ 
b/components/camel-platform-http-main/src/main/java/org/apache/camel/component/platform/http/main/MainHttpServerUtil.java
@@ -45,14 +45,22 @@ public class MainHttpServerUtil {
                 if (last == null || last.size() != endpoints.size() || 
!last.containsAll(endpoints)) {
                     LOG.info(header);
                     int longestEndpoint = 0;
+                    int longestVerbs = 0;
                     for (HttpEndpointModel u : endpoints) {
                         String endpoint = getEndpoint(u);
                         if (endpoint.length() > longestEndpoint) {
                             longestEndpoint = endpoint.length();
                         }
+                        if (u.getVerbs() != null) {
+                            if (u.getVerbs().length() > longestVerbs) {
+                                longestVerbs = u.getVerbs().length();
+                            }
+                        }
                     }
-                    int spacing = 3;
-                    String formatTemplate = "%-" + (longestEndpoint + spacing) 
+ "s %-8s %s";
+                    longestEndpoint += 3; // add some spacing
+                    longestVerbs += 2; // add parenthesis
+                    longestVerbs = Math.max(8, longestVerbs); // minimum length
+                    String formatTemplate = "%-" + longestEndpoint + "s %-" + 
longestVerbs + "s %s";
                     for (HttpEndpointModel u : endpoints) {
                         String endpoint = getEndpoint(u);
                         String formattedVerbs = "";

Reply via email to