Skip to content

PATH

Set a custom endpoint path. Alternative to specifying the path in the HTTP annotation.

Keywords

path

Syntax

path <url-path>

Examples

Custom Path

sql
create function get_user_data()
returns json
language sql
as $$...$$;

comment on function get_user_data() is
'HTTP GET
path /users/data';

Creates: GET /users/data

Path with HTTP Method

sql
comment on function my_function() is
'HTTP GET
PATH /custom/endpoint';

Creates: GET /custom/endpoint

Versioned API

sql
comment on function get_users_v2() is
'HTTP GET
path /api/v2/users';

Behavior

  • Overrides the auto-generated path
  • Path should start with / for absolute paths
  • Can be used alongside HTTP annotation
  • HTTP - Define endpoint (can also set path)

Released under the MIT License.