-
-
Save obohrer/c7011444273c36235558 to your computer and use it in GitHub Desktop.
The goal here is to have a definition of api endpoints which can be used to generate documentation (iodocs for example).
The "wrappers" entry allows each group or separate endpoint to specify wrappers around the endpoint implementation which can be used for auth checks, stats, ...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(endpoints->handler | |
(group "users" | |
{:doc | |
{:description "A group for users routes" | |
:name "Users routes"}} | |
(GET "/:id" | |
{:doc | |
{:description "Get a user" | |
:name "get-user" | |
:params {:id | |
{:type "string" | |
:description "The user id"}}}} | |
{{:keys [id]} :params} | |
stub) | |
(PUT "/:id" | |
{:wrappers [authenticated] | |
:doc | |
{:description "Update a user" | |
:name "update-user" | |
:params {:id | |
{:type "string" | |
:description "The user id"}}}} | |
{{:keys [id]} :params} | |
stub)) | |
(group "posts" | |
{:doc | |
{:description "A group for posts routes" | |
:name "Posts routes"}} | |
(GET "/:id" | |
{:doc | |
{:description "Get a post" | |
:name "get-post" | |
:params {:id | |
{:type "string" | |
:description "The post id"}}}} | |
{{:keys [id]} :params} | |
stub))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment