How to properly structure REST-API endpointsBest Practices for securing a REST API / web serviceHow do I efficiently iterate over each entry in a Java Map?How do I read / convert an InputStream into a String in Java?How do I generate random integers within a specific range in Java?PUT vs. POST in RESTWhat exactly is RESTful programming?How to handle many-to-many relationships in a RESTful API?How do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?REST API Login PatternSOAP vs REST (differences)

What does VB stand for?

Did Captain America make out with his niece?

Who is the god Ao?

Why ReLU function is not differentiable at 0?

Do any languages mention the top limit of a range first?

Why should public servants be apolitical?

Is there a difference between 「目を覚ます」 and 「目覚める」

Determine Beckett Grading Service (BGS) Final Grade

Was Richard I's imprisonment by Leopold of Austria justified?

Will a paper be retracted if a flaw in released software code invalidates its central idea?

What city skyline is this picture of?

I was contacted by a private bank overseas to get my inheritance

Why does putting a dot after the URL remove login information?

Decode a variable-length quantity

Did silent film actors actually say their lines or did they simply improvise “dialogue” while being filmed?

Validation and verification of mathematical models

Why can I log in to my Facebook account with a misspelled email/password?

Can chords be inferred from melody alone?

How does the oscilloscope trigger really work?

Is it double speak?

Where to pee in London?

Purchased new computer from DELL with pre-installed Ubuntu. Won't boot. Should assume its an error from DELL?

Is DC heating faster than AC heating?

Can you use the Help action to give a 2019 UA Artillerist artificer's turret advantage?



How to properly structure REST-API endpoints


Best Practices for securing a REST API / web serviceHow do I efficiently iterate over each entry in a Java Map?How do I read / convert an InputStream into a String in Java?How do I generate random integers within a specific range in Java?PUT vs. POST in RESTWhat exactly is RESTful programming?How to handle many-to-many relationships in a RESTful API?How do I POST JSON data with Curl from a terminal/commandline to Test Spring REST?REST API Login PatternSOAP vs REST (differences)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








8















im quite new with REST-API.



i want to have something like this



POST http://localhost/posts/ <--- PostsController.java
GET http://localhost/posts/id <--- PostsController.java
POST http://localhost/posts/id/comments <--- CommentsController.java
GET http://localhost/posts/id/comments <--- CommentsController.java
GET http://localhost/posts/id/comments/id <--- CommentsController.java


Where the following controllers handle /posts and another controller handler /comments



PostsController.java



@RestController
@RequestMapping("/posts")
public class PostsController
// something



CommentsController.java



@RestController
@RequestMapping("/comments")
public class CommentsController
//do something



How do i maintain the above url whilst having different controllers to handle it?










share|improve this question






























    8















    im quite new with REST-API.



    i want to have something like this



    POST http://localhost/posts/ <--- PostsController.java
    GET http://localhost/posts/id <--- PostsController.java
    POST http://localhost/posts/id/comments <--- CommentsController.java
    GET http://localhost/posts/id/comments <--- CommentsController.java
    GET http://localhost/posts/id/comments/id <--- CommentsController.java


    Where the following controllers handle /posts and another controller handler /comments



    PostsController.java



    @RestController
    @RequestMapping("/posts")
    public class PostsController
    // something



    CommentsController.java



    @RestController
    @RequestMapping("/comments")
    public class CommentsController
    //do something



    How do i maintain the above url whilst having different controllers to handle it?










    share|improve this question


























      8












      8








      8


      1






      im quite new with REST-API.



      i want to have something like this



      POST http://localhost/posts/ <--- PostsController.java
      GET http://localhost/posts/id <--- PostsController.java
      POST http://localhost/posts/id/comments <--- CommentsController.java
      GET http://localhost/posts/id/comments <--- CommentsController.java
      GET http://localhost/posts/id/comments/id <--- CommentsController.java


      Where the following controllers handle /posts and another controller handler /comments



      PostsController.java



      @RestController
      @RequestMapping("/posts")
      public class PostsController
      // something



      CommentsController.java



      @RestController
      @RequestMapping("/comments")
      public class CommentsController
      //do something



      How do i maintain the above url whilst having different controllers to handle it?










      share|improve this question














      im quite new with REST-API.



      i want to have something like this



      POST http://localhost/posts/ <--- PostsController.java
      GET http://localhost/posts/id <--- PostsController.java
      POST http://localhost/posts/id/comments <--- CommentsController.java
      GET http://localhost/posts/id/comments <--- CommentsController.java
      GET http://localhost/posts/id/comments/id <--- CommentsController.java


      Where the following controllers handle /posts and another controller handler /comments



      PostsController.java



      @RestController
      @RequestMapping("/posts")
      public class PostsController
      // something



      CommentsController.java



      @RestController
      @RequestMapping("/comments")
      public class CommentsController
      //do something



      How do i maintain the above url whilst having different controllers to handle it?







      java spring rest spring-restcontroller






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 28 at 3:45









      lemoncodeslemoncodes

      1,0768 gold badges27 silver badges44 bronze badges




      1,0768 gold badges27 silver badges44 bronze badges

























          2 Answers
          2






          active

          oldest

          votes


















          4














          I'll share my expreience here.
          When I work with Rest controllers, I always try to understand what is the "core" entity - a notion we deal with and what are just criterias for queries. Usually the "core" entity appears right after the context path.



          Note that this doesn't really depend on an actual implementation at the level of database.



          So it looks like all the cases are actually about the "post" entity that's why you've put it in the first place (in the case of comments by post, you didn't opt for something like this http://localhost/comments?post=123 and that's ok, it just means that post is your "main" entity to serve.



          In this case I think all the operations can be done in PostsController.



          Now an important side-note about controllers in Spring / SpringBoot.
          People tend to put business logic in these controllers and I believe its a mistake. Controllers should not contain any real logic, maybe some light input transformations / validations but that's it. Leave a real work to "Services" not to controllers, keep controllers to be an entry point for your backend. Now why I'm stating this? Because controllers, if written in this way are really small classes, so you won't get a one "giant" class that handles all, which, I believe, might be an argument for separation to different controllers.



          Ok, so what is comments in this case? It depends on how you think about it, but as you wrote in end-points list, is a property of post (something that belongs to the post/ always associated with the post), so its a "Criteria of search": give me a post with comments, give me only a post without comments, give me a post that has comments only from today and yesterday, the point is that you always query for "post", not for comments.



          From the purely technical standpoint, the @RequestMapping in spring boot when put on controller class says that only /post can be queried by this controller.
          You can also set different values on @GetMapping/@PostMapping annotations but that's
          it. If should be flexible enough to design the level of rest controllers.






          share|improve this answer

























          • Agree, i might be over thinking of over simplifying classes though. My controller is as what you've said. My services do all the work. I ask this because i was thinking of separating the class to be modular (file level) and not thinking of the bigger picture (the design).

            – lemoncodes
            Jul 28 at 6:06











          • Agree with Mark. Comments are part of Post (Core Entity for comment) which can be placed within PostController as it is can be considered as "Criteria of search", at last, its a matter of choice

            – Patel Romil
            Jul 28 at 8:23


















          7














          Here is the skeleton for both the controllers with endpoints, But still you can also have all these endpoints in one controller or different, some people differentiate them based on methods, some based on paths, so i believe this is completely developer experience how to design this



          PostsController.java



          @RestController
          @RequestMapping("/posts")
          public class PostsController

          @PostMapping("/")
          public String createPosts()

          return "createPosts";



          @GetMapping("/id")
          public String getPosts(@PathVariable(name = "id") String id)
          return "getPosts......" + id;





          CommentsController.java



          @RestController
          @RequestMapping("/posts/id/comments")
          public class CommentsController

          @PostMapping
          public String createComment(@PathVariable(name = "id") String id)
          return "createComment..." + id;


          @GetMapping
          public String getComment(@PathVariable(name = "id") String id)
          return "getComment..." + id;


          @GetMapping("/id1@Path")
          public String getCommentById(@PathVariable(name = "id") String id, @PathVariable(name = "id1") String id1)
          return "getComment..." + id + "...." + id1;








          share|improve this answer



























          • I give this props. However, bottom line is this is a design perspective. As discussed stackoverflow.com/a/57238255/1545664. I give props for providing a solution (technical). But i will chose the answer on the design part

            – lemoncodes
            Jul 28 at 12:04













          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f57237774%2fhow-to-properly-structure-rest-api-endpoints%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          I'll share my expreience here.
          When I work with Rest controllers, I always try to understand what is the "core" entity - a notion we deal with and what are just criterias for queries. Usually the "core" entity appears right after the context path.



          Note that this doesn't really depend on an actual implementation at the level of database.



          So it looks like all the cases are actually about the "post" entity that's why you've put it in the first place (in the case of comments by post, you didn't opt for something like this http://localhost/comments?post=123 and that's ok, it just means that post is your "main" entity to serve.



          In this case I think all the operations can be done in PostsController.



          Now an important side-note about controllers in Spring / SpringBoot.
          People tend to put business logic in these controllers and I believe its a mistake. Controllers should not contain any real logic, maybe some light input transformations / validations but that's it. Leave a real work to "Services" not to controllers, keep controllers to be an entry point for your backend. Now why I'm stating this? Because controllers, if written in this way are really small classes, so you won't get a one "giant" class that handles all, which, I believe, might be an argument for separation to different controllers.



          Ok, so what is comments in this case? It depends on how you think about it, but as you wrote in end-points list, is a property of post (something that belongs to the post/ always associated with the post), so its a "Criteria of search": give me a post with comments, give me only a post without comments, give me a post that has comments only from today and yesterday, the point is that you always query for "post", not for comments.



          From the purely technical standpoint, the @RequestMapping in spring boot when put on controller class says that only /post can be queried by this controller.
          You can also set different values on @GetMapping/@PostMapping annotations but that's
          it. If should be flexible enough to design the level of rest controllers.






          share|improve this answer

























          • Agree, i might be over thinking of over simplifying classes though. My controller is as what you've said. My services do all the work. I ask this because i was thinking of separating the class to be modular (file level) and not thinking of the bigger picture (the design).

            – lemoncodes
            Jul 28 at 6:06











          • Agree with Mark. Comments are part of Post (Core Entity for comment) which can be placed within PostController as it is can be considered as "Criteria of search", at last, its a matter of choice

            – Patel Romil
            Jul 28 at 8:23















          4














          I'll share my expreience here.
          When I work with Rest controllers, I always try to understand what is the "core" entity - a notion we deal with and what are just criterias for queries. Usually the "core" entity appears right after the context path.



          Note that this doesn't really depend on an actual implementation at the level of database.



          So it looks like all the cases are actually about the "post" entity that's why you've put it in the first place (in the case of comments by post, you didn't opt for something like this http://localhost/comments?post=123 and that's ok, it just means that post is your "main" entity to serve.



          In this case I think all the operations can be done in PostsController.



          Now an important side-note about controllers in Spring / SpringBoot.
          People tend to put business logic in these controllers and I believe its a mistake. Controllers should not contain any real logic, maybe some light input transformations / validations but that's it. Leave a real work to "Services" not to controllers, keep controllers to be an entry point for your backend. Now why I'm stating this? Because controllers, if written in this way are really small classes, so you won't get a one "giant" class that handles all, which, I believe, might be an argument for separation to different controllers.



          Ok, so what is comments in this case? It depends on how you think about it, but as you wrote in end-points list, is a property of post (something that belongs to the post/ always associated with the post), so its a "Criteria of search": give me a post with comments, give me only a post without comments, give me a post that has comments only from today and yesterday, the point is that you always query for "post", not for comments.



          From the purely technical standpoint, the @RequestMapping in spring boot when put on controller class says that only /post can be queried by this controller.
          You can also set different values on @GetMapping/@PostMapping annotations but that's
          it. If should be flexible enough to design the level of rest controllers.






          share|improve this answer

























          • Agree, i might be over thinking of over simplifying classes though. My controller is as what you've said. My services do all the work. I ask this because i was thinking of separating the class to be modular (file level) and not thinking of the bigger picture (the design).

            – lemoncodes
            Jul 28 at 6:06











          • Agree with Mark. Comments are part of Post (Core Entity for comment) which can be placed within PostController as it is can be considered as "Criteria of search", at last, its a matter of choice

            – Patel Romil
            Jul 28 at 8:23













          4












          4








          4







          I'll share my expreience here.
          When I work with Rest controllers, I always try to understand what is the "core" entity - a notion we deal with and what are just criterias for queries. Usually the "core" entity appears right after the context path.



          Note that this doesn't really depend on an actual implementation at the level of database.



          So it looks like all the cases are actually about the "post" entity that's why you've put it in the first place (in the case of comments by post, you didn't opt for something like this http://localhost/comments?post=123 and that's ok, it just means that post is your "main" entity to serve.



          In this case I think all the operations can be done in PostsController.



          Now an important side-note about controllers in Spring / SpringBoot.
          People tend to put business logic in these controllers and I believe its a mistake. Controllers should not contain any real logic, maybe some light input transformations / validations but that's it. Leave a real work to "Services" not to controllers, keep controllers to be an entry point for your backend. Now why I'm stating this? Because controllers, if written in this way are really small classes, so you won't get a one "giant" class that handles all, which, I believe, might be an argument for separation to different controllers.



          Ok, so what is comments in this case? It depends on how you think about it, but as you wrote in end-points list, is a property of post (something that belongs to the post/ always associated with the post), so its a "Criteria of search": give me a post with comments, give me only a post without comments, give me a post that has comments only from today and yesterday, the point is that you always query for "post", not for comments.



          From the purely technical standpoint, the @RequestMapping in spring boot when put on controller class says that only /post can be queried by this controller.
          You can also set different values on @GetMapping/@PostMapping annotations but that's
          it. If should be flexible enough to design the level of rest controllers.






          share|improve this answer













          I'll share my expreience here.
          When I work with Rest controllers, I always try to understand what is the "core" entity - a notion we deal with and what are just criterias for queries. Usually the "core" entity appears right after the context path.



          Note that this doesn't really depend on an actual implementation at the level of database.



          So it looks like all the cases are actually about the "post" entity that's why you've put it in the first place (in the case of comments by post, you didn't opt for something like this http://localhost/comments?post=123 and that's ok, it just means that post is your "main" entity to serve.



          In this case I think all the operations can be done in PostsController.



          Now an important side-note about controllers in Spring / SpringBoot.
          People tend to put business logic in these controllers and I believe its a mistake. Controllers should not contain any real logic, maybe some light input transformations / validations but that's it. Leave a real work to "Services" not to controllers, keep controllers to be an entry point for your backend. Now why I'm stating this? Because controllers, if written in this way are really small classes, so you won't get a one "giant" class that handles all, which, I believe, might be an argument for separation to different controllers.



          Ok, so what is comments in this case? It depends on how you think about it, but as you wrote in end-points list, is a property of post (something that belongs to the post/ always associated with the post), so its a "Criteria of search": give me a post with comments, give me only a post without comments, give me a post that has comments only from today and yesterday, the point is that you always query for "post", not for comments.



          From the purely technical standpoint, the @RequestMapping in spring boot when put on controller class says that only /post can be queried by this controller.
          You can also set different values on @GetMapping/@PostMapping annotations but that's
          it. If should be flexible enough to design the level of rest controllers.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 28 at 5:39









          Mark BramnikMark Bramnik

          13.6k3 gold badges28 silver badges53 bronze badges




          13.6k3 gold badges28 silver badges53 bronze badges















          • Agree, i might be over thinking of over simplifying classes though. My controller is as what you've said. My services do all the work. I ask this because i was thinking of separating the class to be modular (file level) and not thinking of the bigger picture (the design).

            – lemoncodes
            Jul 28 at 6:06











          • Agree with Mark. Comments are part of Post (Core Entity for comment) which can be placed within PostController as it is can be considered as "Criteria of search", at last, its a matter of choice

            – Patel Romil
            Jul 28 at 8:23

















          • Agree, i might be over thinking of over simplifying classes though. My controller is as what you've said. My services do all the work. I ask this because i was thinking of separating the class to be modular (file level) and not thinking of the bigger picture (the design).

            – lemoncodes
            Jul 28 at 6:06











          • Agree with Mark. Comments are part of Post (Core Entity for comment) which can be placed within PostController as it is can be considered as "Criteria of search", at last, its a matter of choice

            – Patel Romil
            Jul 28 at 8:23
















          Agree, i might be over thinking of over simplifying classes though. My controller is as what you've said. My services do all the work. I ask this because i was thinking of separating the class to be modular (file level) and not thinking of the bigger picture (the design).

          – lemoncodes
          Jul 28 at 6:06





          Agree, i might be over thinking of over simplifying classes though. My controller is as what you've said. My services do all the work. I ask this because i was thinking of separating the class to be modular (file level) and not thinking of the bigger picture (the design).

          – lemoncodes
          Jul 28 at 6:06













          Agree with Mark. Comments are part of Post (Core Entity for comment) which can be placed within PostController as it is can be considered as "Criteria of search", at last, its a matter of choice

          – Patel Romil
          Jul 28 at 8:23





          Agree with Mark. Comments are part of Post (Core Entity for comment) which can be placed within PostController as it is can be considered as "Criteria of search", at last, its a matter of choice

          – Patel Romil
          Jul 28 at 8:23













          7














          Here is the skeleton for both the controllers with endpoints, But still you can also have all these endpoints in one controller or different, some people differentiate them based on methods, some based on paths, so i believe this is completely developer experience how to design this



          PostsController.java



          @RestController
          @RequestMapping("/posts")
          public class PostsController

          @PostMapping("/")
          public String createPosts()

          return "createPosts";



          @GetMapping("/id")
          public String getPosts(@PathVariable(name = "id") String id)
          return "getPosts......" + id;





          CommentsController.java



          @RestController
          @RequestMapping("/posts/id/comments")
          public class CommentsController

          @PostMapping
          public String createComment(@PathVariable(name = "id") String id)
          return "createComment..." + id;


          @GetMapping
          public String getComment(@PathVariable(name = "id") String id)
          return "getComment..." + id;


          @GetMapping("/id1@Path")
          public String getCommentById(@PathVariable(name = "id") String id, @PathVariable(name = "id1") String id1)
          return "getComment..." + id + "...." + id1;








          share|improve this answer



























          • I give this props. However, bottom line is this is a design perspective. As discussed stackoverflow.com/a/57238255/1545664. I give props for providing a solution (technical). But i will chose the answer on the design part

            – lemoncodes
            Jul 28 at 12:04















          7














          Here is the skeleton for both the controllers with endpoints, But still you can also have all these endpoints in one controller or different, some people differentiate them based on methods, some based on paths, so i believe this is completely developer experience how to design this



          PostsController.java



          @RestController
          @RequestMapping("/posts")
          public class PostsController

          @PostMapping("/")
          public String createPosts()

          return "createPosts";



          @GetMapping("/id")
          public String getPosts(@PathVariable(name = "id") String id)
          return "getPosts......" + id;





          CommentsController.java



          @RestController
          @RequestMapping("/posts/id/comments")
          public class CommentsController

          @PostMapping
          public String createComment(@PathVariable(name = "id") String id)
          return "createComment..." + id;


          @GetMapping
          public String getComment(@PathVariable(name = "id") String id)
          return "getComment..." + id;


          @GetMapping("/id1@Path")
          public String getCommentById(@PathVariable(name = "id") String id, @PathVariable(name = "id1") String id1)
          return "getComment..." + id + "...." + id1;








          share|improve this answer



























          • I give this props. However, bottom line is this is a design perspective. As discussed stackoverflow.com/a/57238255/1545664. I give props for providing a solution (technical). But i will chose the answer on the design part

            – lemoncodes
            Jul 28 at 12:04













          7












          7








          7







          Here is the skeleton for both the controllers with endpoints, But still you can also have all these endpoints in one controller or different, some people differentiate them based on methods, some based on paths, so i believe this is completely developer experience how to design this



          PostsController.java



          @RestController
          @RequestMapping("/posts")
          public class PostsController

          @PostMapping("/")
          public String createPosts()

          return "createPosts";



          @GetMapping("/id")
          public String getPosts(@PathVariable(name = "id") String id)
          return "getPosts......" + id;





          CommentsController.java



          @RestController
          @RequestMapping("/posts/id/comments")
          public class CommentsController

          @PostMapping
          public String createComment(@PathVariable(name = "id") String id)
          return "createComment..." + id;


          @GetMapping
          public String getComment(@PathVariable(name = "id") String id)
          return "getComment..." + id;


          @GetMapping("/id1@Path")
          public String getCommentById(@PathVariable(name = "id") String id, @PathVariable(name = "id1") String id1)
          return "getComment..." + id + "...." + id1;








          share|improve this answer















          Here is the skeleton for both the controllers with endpoints, But still you can also have all these endpoints in one controller or different, some people differentiate them based on methods, some based on paths, so i believe this is completely developer experience how to design this



          PostsController.java



          @RestController
          @RequestMapping("/posts")
          public class PostsController

          @PostMapping("/")
          public String createPosts()

          return "createPosts";



          @GetMapping("/id")
          public String getPosts(@PathVariable(name = "id") String id)
          return "getPosts......" + id;





          CommentsController.java



          @RestController
          @RequestMapping("/posts/id/comments")
          public class CommentsController

          @PostMapping
          public String createComment(@PathVariable(name = "id") String id)
          return "createComment..." + id;


          @GetMapping
          public String getComment(@PathVariable(name = "id") String id)
          return "getComment..." + id;


          @GetMapping("/id1@Path")
          public String getCommentById(@PathVariable(name = "id") String id, @PathVariable(name = "id1") String id1)
          return "getComment..." + id + "...." + id1;









          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jul 28 at 6:18

























          answered Jul 28 at 6:12









          DeadpoolDeadpool

          12.5k2 gold badges13 silver badges42 bronze badges




          12.5k2 gold badges13 silver badges42 bronze badges















          • I give this props. However, bottom line is this is a design perspective. As discussed stackoverflow.com/a/57238255/1545664. I give props for providing a solution (technical). But i will chose the answer on the design part

            – lemoncodes
            Jul 28 at 12:04

















          • I give this props. However, bottom line is this is a design perspective. As discussed stackoverflow.com/a/57238255/1545664. I give props for providing a solution (technical). But i will chose the answer on the design part

            – lemoncodes
            Jul 28 at 12:04
















          I give this props. However, bottom line is this is a design perspective. As discussed stackoverflow.com/a/57238255/1545664. I give props for providing a solution (technical). But i will chose the answer on the design part

          – lemoncodes
          Jul 28 at 12:04





          I give this props. However, bottom line is this is a design perspective. As discussed stackoverflow.com/a/57238255/1545664. I give props for providing a solution (technical). But i will chose the answer on the design part

          – lemoncodes
          Jul 28 at 12:04

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f57237774%2fhow-to-properly-structure-rest-api-endpoints%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

          Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

          Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?