metamaps--metamaps/doc/api/apis/synapses.raml
Devin Howard 8a95262f2c allow anonymous users to GET api routes (#842)
* make map methods use ActiveRecord relations so they don't error on pundit

* test for logged out maps GET api

* open up GET routes on maps/topics/synapses and update api docs
2016-10-26 08:37:23 +08:00

102 lines
2.8 KiB
Text

#type: collection
get:
is: [ searchable: { searchFields: "desc" }, embeddable: { embedFields: "topic1,topic2,user" }, orderable, pageable ]
securedBy: [ null, cookie, token, oauth_2_0 ]
responses:
200:
body:
application/json:
example: !include ../examples/synapses.json
post:
body:
application/json:
properties:
desc:
description: text description of this synapse
required: false
category:
description: |
<code>from-to</code> or <code>both</code>
permission:
description: commons, public, or private
topic1_id:
description: the topic being linked from
topic2_id:
description: the topic being linked to
user_id:
description: the creator of the topic
responses:
201:
body:
application/json:
example: !include ../examples/synapse.json
/{id}:
#type: item
get:
is: [ embeddable: { embedFields: "topic1,topic2,user" } ]
securedBy: [ null, cookie, token, oauth_2_0 ]
responses:
200:
body:
application/json:
example: !include ../examples/synapse.json
put:
body:
application/json:
properties:
desc:
description: text description of this synapse
required: false
category:
description: |
<code>from-to</code> or <code>both</code>
required: false
permission:
description: commons, public, or private
required: false
topic1_id:
description: the topic being linked from
required: false
topic2_id:
description: the topic being linked to
required: false
user_id:
description: the creator of the topic
required: false
responses:
200:
body:
application/json:
example: !include ../examples/synapse.json
patch:
body:
application/json:
properties:
desc:
description: text description of this synapse
required: false
category:
description: |
<code>from-to</code> or <code>both</code>
required: false
permission:
description: commons, public, or private
required: false
topic1_id:
description: the topic being linked from
required: false
topic2_id:
description: the topic being linked to
required: false
user_id:
description: the creator of the topic
required: false
responses:
200:
body:
application/json:
example: !include ../examples/synapse.json
delete:
responses:
204:
description: No content