spring-projects / sts4

The next generation of tooling for Spring Boot, including support for Cloud Foundry manifest files, Concourse CI pipeline definitions, BOSH deployment manifests, and more... - Available for Eclipse, Visual Studio Code, and Theia
https://spring.io/tools
Eclipse Public License 1.0
878 stars 206 forks source link

Consideration to improve "Request Mappings" for Spring Boot Actuator to request data for URL/URI execution #1340

Open manueljordan opened 2 months ago

manueljordan commented 2 months ago

Hello Team

For a Spring Boot project working with Web and Actuator

Observe the following Figure

STS-ACTUATOR-01

If I do double click in the /ciencias/uri/ciencias URI selected (The one located in the Path header) then is opened the internal web browser and works, it because the URI does not work with:

Now consider the following URI

STS-ACTUATOR-02

As you can see the /ciencias/uri/ciencias/{id} URI works with the {id} path variable. So when is applied double click then the internal web browser is opened as expected but shows the following error:

STS-ACTUATOR-03

Of course it has sense because the {id} path variable never was defined.

Therefore: Could you pls consider in improve by adding the following feature?:

It such as the same approach to work with varargs such as a Object....

Consider the same request if the handler method works with at least one Request Parameter

The point is that there is flexibility.

It would be applied for DELETE where is need it normally a {id} too. Now for POST and PUT the Dialog Window through the unique text field should let put the content data as either json or xml format. Something similar as cURL

So far I think it has sense, but would be problematic for:

Let me know your thoughts

martinlippert commented 2 months ago

All this makes perfect sense to @manueljordan , something like this crossed our mind many times before. There are existing tools that let you experiment with HTTP endpoints of all kinds (e.g. https://blog.jetbrains.com/idea/2020/09/at-your-request-use-the-http-client-in-intellij-idea-for-spring-boot-restful-web-services/, https://marketplace.visualstudio.com/items?itemName=humao.rest-client, and probably more).

The idea here would be to not go down the path of implementing our own HTTP client in an IDE specific way, so something that works exclusively in Eclipse for example. We would either look at connecting the live information from the Spring Boot applications (for example the properties page you are referring to) to an existing tool or - in case we implement something on our own - try to do it in an IDE agnostic way.

A quick search for Eclipse only brings up https://marketplace.eclipse.org/content/http4e-http-and-rest-client-eclipse, which seems to be outdated and no longer working since a long time.

If we really want to do something like this in a serious way, we need to move away from invoking the internal (or external) browser with an URL, and instead run the HTTP request on our own. This would allow us to pass in request body data, show all the details of the request and the response, etc.

manueljordan commented 1 month ago

Thanks for the feedback

It seems the ideal scenario is create by complete a Full GUI HTTP client. Am I correct? I think it would be perfect but it requires a lot of efforts and I know this nice IDE has other priorities but:

This party tool would be configured just once through Preferences - something similar as Web that offers to configure to use either the internal web browser or an external Web Browser.

Thanks for the links provided