Ask Your Question
1

What is the way to name parameters and REST API urls in Spring Boot?

asked 2022-01-14 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-10-03 15:00:00 +0000

pufferfish gravatar image

Parameter names in Spring Boot are usually named using camelCase notation, which means that the first word should start with a lowercase letter and subsequent words should start with an uppercase letter. For example, firstName, lastName, or numberOfAttempts.

For REST API URLs, there is no fixed convention, but it is recommended to use a consistent naming scheme to make the URLs more readable and understandable. One common approach is to use hyphens to separate words in the URL path, for example, /api/users/{id}/orders or /api/products/{id}, where {id} is the ID of the resource being accessed.

Another approach is to use underscores to separate words in the URL path, for example, /api/getuserdetails or /api/createneworder. However, it is important to note that the URL path should be kept simple and short, and it should accurately represent the resource being accessed.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-01-14 11:00:00 +0000

Seen: 9 times

Last updated: Oct 03 '21