Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
manueljordan opened this issue Aug 30, 2024 · 2 comments

Comments

@manueljordan
Copy link

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:

  • netiher a parameter nor path variable

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?:

  • If the IDE detects at least a path variable then when is accomplished the double click a small dialog window should appear with a text field to put the path variables separated by commas

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

  • Does it have sense to you?
  • Or Did I do understand incorrectly the purpose of Request Mappings?

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

  • HTML for POST and even being viable for DELETE and PUT too because is used the HiddenHttpMethodFilter class - How to send the data?
  • HTML or REST working with either paging and sorting (even both together) - How to send these extra parameters?

Let me know your thoughts

@martinlippert
Copy link
Member

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
Copy link
Author

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:

  • perhaps a special dialog window would be opened to request to call a third party tool?. Does have sense to you?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants