Is there any naming rules of path while implements REST Endpoint?

Hi all,

I’m developing an add-on. I need to implement REST Plugin Module so that calls data I want to get.
So I’m doing brain storming to name for the path.

I know that JIRA REST api uses the following url form…‘http://host:port/context/rest/api-name/api-version/resource-name’.
And In the case of REST Module, I think that the general path is …‘http://host:port/jira/rest/aaa/bbb/ccc’

In my case, I’m using ‘jira/rest/permissionservice/1.0/check/permissions’ to check permissions.

If you implements the same REST endpoint, what do you think about the best url for this function?
I would appreciate that let me know your opinion, Thank you.

I would highly recommend making sure you have your add-ons name or your company’s name in the base path (or better yet - do both) i.e. what you define in the <rest path="..." in atlassian-plugin.xml.

There are 2 reasons for this:

  1. The path’s are global. If you define /permissionservice in your add-on and I then define /permissionservice in some other add-on - there will be a collision. One of us will will but it will depend on which add-on gets started when. Not really that awesome for debugging purposes. :slight_smile:
  2. When you do support - if you have your company name(or variation) that’s easily searchable - you can easily ask your customer to do grep /rest/my-company logfile.log in the logs.

Same thing goes with any servlets or actions.