update api and docs
This commit is contained in:
parent
2beaa2e5be
commit
5c12949c8d
6 changed files with 26 additions and 2 deletions
|
@ -18,6 +18,7 @@ module Api
|
|||
def self.embeddable
|
||||
{
|
||||
user: {},
|
||||
source: {},
|
||||
topics: {},
|
||||
synapses: {},
|
||||
mappings: {},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#type: collection
|
||||
get:
|
||||
is: [ searchable: { searchFields: "name, desc" }, embeddable: { embedFields: "user,topics,synapses,mappings,contributors,collaborators" }, orderable, pageable ]
|
||||
is: [ searchable: { searchFields: "name, desc" }, embeddable: { embedFields: "user,source,topics,synapses,mappings,contributors,collaborators" }, orderable, pageable ]
|
||||
securedBy: [ null, token, oauth_2_0, cookie ]
|
||||
queryParameters:
|
||||
user_id:
|
||||
|
@ -23,6 +23,8 @@ post:
|
|||
description: description
|
||||
permission:
|
||||
description: commons, public, or private
|
||||
source_id:
|
||||
description: the id of the map this map is a fork of
|
||||
screenshot:
|
||||
description: url to a screenshot of the map
|
||||
contributor_ids:
|
||||
|
@ -37,7 +39,7 @@ post:
|
|||
/{id}:
|
||||
#type: item
|
||||
get:
|
||||
is: [ embeddable: { embedFields: "user,topics,synapses,mappings,contributors,collaborators" } ]
|
||||
is: [ embeddable: { embedFields: "user,source,topics,synapses,mappings,contributors,collaborators" } ]
|
||||
securedBy: [ null, token, oauth_2_0, cookie ]
|
||||
responses:
|
||||
200:
|
||||
|
@ -60,6 +62,9 @@ post:
|
|||
screenshot:
|
||||
description: url to a screenshot of the map
|
||||
required: false
|
||||
source_id:
|
||||
description: the id of the map this map is a fork of
|
||||
required: false
|
||||
responses:
|
||||
200:
|
||||
body:
|
||||
|
@ -81,6 +86,9 @@ post:
|
|||
screenshot:
|
||||
description: url to a screenshot of the map
|
||||
required: false
|
||||
source_id:
|
||||
description: the id of the map this map is a fork of
|
||||
required: false
|
||||
responses:
|
||||
200:
|
||||
body:
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"created_at": "2016-03-26T08:02:05.379Z",
|
||||
"updated_at": "2016-03-27T07:20:18.047Z",
|
||||
"user_id": 1234,
|
||||
"source_id": null,
|
||||
"topic_ids": [
|
||||
58,
|
||||
59
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"created_at": "2016-03-26T08:02:05.379Z",
|
||||
"updated_at": "2016-03-27T07:20:18.047Z",
|
||||
"user_id": 1234,
|
||||
"source_id": null,
|
||||
"topic_ids": [
|
||||
58,
|
||||
59
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
"created_at": "2016-03-26T08:02:05.379Z",
|
||||
"updated_at": "2016-03-27T07:20:18.047Z",
|
||||
"user_id": 1234,
|
||||
"source_id": 2,
|
||||
"topic_ids": [
|
||||
58,
|
||||
59
|
||||
|
|
|
@ -33,6 +33,12 @@
|
|||
"user": {
|
||||
"$ref": "_user.json"
|
||||
},
|
||||
"source_id": {
|
||||
"$ref": "_id.json"
|
||||
},
|
||||
"source": {
|
||||
"$ref": "_map.json"
|
||||
},
|
||||
"topic_ids": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
|
@ -111,6 +117,12 @@
|
|||
{ "required": [ "user" ] }
|
||||
]
|
||||
},
|
||||
{
|
||||
"oneOf": [
|
||||
{ "required": [ "source_id" ] },
|
||||
{ "required": [ "source" ] }
|
||||
]
|
||||
},
|
||||
{
|
||||
"oneOf": [
|
||||
{ "required": [ "topic_ids" ] },
|
||||
|
|
Loading…
Add table
Reference in a new issue