Update descriptions/examples for docs
Applied suggestions from code review Co-authored-by: Eldad A. Fux <eldad.fux@gmail.com>
This commit is contained in:
parent
4c81d6b490
commit
12b58b00ac
|
@ -310,7 +310,7 @@ App::get('v1/database/collections/:collectionId/attributes')
|
|||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ATTRIBUTE_LIST)
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->inject('response')
|
||||
->inject('dbForExternal')
|
||||
->action(function ($collectionId, $response, $dbForExternal) {
|
||||
|
@ -348,7 +348,7 @@ App::get('v1/database/collections/:collectionId/attributes/:attributeId')
|
|||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_ATTRIBUTE)
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('attributeId', '', new Key(), 'Attribute ID.')
|
||||
->inject('response')
|
||||
->inject('dbForExternal')
|
||||
|
@ -389,7 +389,7 @@ App::delete('/v1/database/collections/:collectionId/attributes/:attributeId')
|
|||
->label('sdk.description', '/docs/references/database/delete-attribute.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('attributeId', '', new Key(), 'Attribute ID.')
|
||||
->inject('response')
|
||||
->inject('dbForExternal')
|
||||
|
@ -452,7 +452,7 @@ App::post('/v1/database/collections/:collectionId/indexes')
|
|||
->label('sdk.response.code', Response::STATUS_CODE_CREATED)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_INDEX)
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('id', null, new Key(), 'Index ID.')
|
||||
->param('type', null, new WhiteList([Database::INDEX_KEY, Database::INDEX_FULLTEXT, Database::INDEX_UNIQUE, Database::INDEX_SPATIAL, Database::INDEX_ARRAY]), 'Index type.')
|
||||
->param('attributes', null, new ArrayList(new Key()), 'Array of attributes to index.')
|
||||
|
@ -517,7 +517,7 @@ App::get('v1/database/collections/:collectionId/indexes')
|
|||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_INDEX_LIST)
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->inject('response')
|
||||
->inject('dbForExternal')
|
||||
->action(function ($collectionId, $response, $dbForExternal) {
|
||||
|
@ -555,7 +555,7 @@ App::get('v1/database/collections/:collectionId/indexes/:indexId')
|
|||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_INDEX)
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('indexId', null, new Key(), 'Index ID.')
|
||||
->inject('response')
|
||||
->inject('dbForExternal')
|
||||
|
@ -596,7 +596,7 @@ App::delete('/v1/database/collections/:collectionId/indexes/:indexId')
|
|||
->label('sdk.description', '/docs/references/database/delete-index.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('indexId', '', new Key(), 'Index ID.')
|
||||
->inject('response')
|
||||
->inject('dbForExternal')
|
||||
|
@ -742,7 +742,7 @@ App::get('/v1/database/collections/:collectionId/documents')
|
|||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_DOCUMENT_LIST)
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('collectionId', '', new UID(), 'Collection unique ID. You can create a new collection using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('queries', [], new ArrayList(new Text(128)), 'Array of query strings.', true)
|
||||
->param('limit', 25, new Range(0, 100), 'Maximum number of documents to return in response. Use this value to manage pagination. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
|
||||
->param('offset', 0, new Range(0, 900000000), 'Offset value. The default value is 0. Use this param to manage pagination.', true)
|
||||
|
@ -783,7 +783,7 @@ App::get('/v1/database/collections/:collectionId/documents/:documentId')
|
|||
->label('sdk.response.code', Response::STATUS_CODE_OK)
|
||||
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
|
||||
->label('sdk.response.model', Response::MODEL_DOCUMENT)
|
||||
->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('documentId', null, new UID(), 'Document unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForExternal')
|
||||
|
@ -888,7 +888,7 @@ App::delete('/v1/database/collections/:collectionId/documents/:documentId')
|
|||
->label('sdk.description', '/docs/references/database/delete-document.md')
|
||||
->label('sdk.response.code', Response::STATUS_CODE_NOCONTENT)
|
||||
->label('sdk.response.model', Response::MODEL_NONE)
|
||||
->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection with validation rules using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('collectionId', null, new UID(), 'Collection unique ID. You can create a new collection using the Database service [server integration](/docs/server/database#createCollection).')
|
||||
->param('documentId', null, new UID(), 'Document unique ID.')
|
||||
->inject('response')
|
||||
->inject('dbForExternal')
|
||||
|
|
|
@ -15,20 +15,20 @@ class Collection extends Model
|
|||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Collection ID.',
|
||||
'default' => '',
|
||||
'example' => '',
|
||||
'example' => '5e5ea5c16897e',
|
||||
])
|
||||
->addRule('$read', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Collection read permissions.',
|
||||
'default' => '',
|
||||
'example' => '',
|
||||
'example' => 'role:all',
|
||||
'array' => true
|
||||
])
|
||||
->addRule('$write', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Collection write permissions.',
|
||||
'default' => '',
|
||||
'example' => '',
|
||||
'example' => 'user:608f9da25e7e1',
|
||||
'array' => true
|
||||
])
|
||||
->addRule('name', [
|
||||
|
@ -87,4 +87,4 @@ class Collection extends Model
|
|||
{
|
||||
return Response::MODEL_COLLECTION;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,14 +45,14 @@ class Document extends Any
|
|||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Document read permissions.',
|
||||
'default' => '',
|
||||
'example' => '',
|
||||
'example' => 'role:all',
|
||||
'array' => true,
|
||||
])
|
||||
->addRule('$write', [
|
||||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Document write permissions.',
|
||||
'default' => '',
|
||||
'example' => '',
|
||||
'example' => 'user:608f9da25e7e1',
|
||||
'array' => true,
|
||||
])
|
||||
;
|
||||
|
|
|
@ -14,7 +14,7 @@ class Index extends Model
|
|||
'type' => self::TYPE_STRING,
|
||||
'description' => 'Collection ID.',
|
||||
'default' => '',
|
||||
'example' => '',
|
||||
'example' => '5e5ea5c16d55',
|
||||
])
|
||||
->addRule('$id', [
|
||||
'type' => self::TYPE_STRING,
|
||||
|
@ -73,4 +73,4 @@ class Index extends Model
|
|||
{
|
||||
return Response::MODEL_INDEX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue