1
0
Fork 0

added some query and header parameters to the swagger tags

This commit is contained in:
Thomas Richter 2013-04-24 15:28:31 +02:00
parent 8ee9e2dbb6
commit cb940c85bd
2 changed files with 37 additions and 5 deletions

View File

@ -276,7 +276,7 @@ def generateArangoshRun():
print "var logCurlRequest = function () { var r = logCurlRequestRaw.apply(logCurlRequestRaw, arguments); db._collections(); return r; };" print "var logCurlRequest = function () { var r = logCurlRequestRaw.apply(logCurlRequestRaw, arguments); db._collections(); return r; };"
print "var logJsonResponse = require('internal').appendJsonResponse(appender);" print "var logJsonResponse = require('internal').appendJsonResponse(appender);"
print "var assert = function(a) { if (! a) { internal.output('%s\\nASSERTION FAILED: %s\\n%s\\n'); throw new Error('assertion failed'); } };" % ('#' * 80, key, '#' * 80) print "var assert = function(a) { if (! a) { internal.output('%s\\nASSERTION FAILED: %s\\n%s\\n'); throw new Error('assertion failed'); } };" % ('#' * 80, key, '#' * 80)
print "try { %s internal.output('RUN SUCCEEDED: %s'); } catch (err) { print('%s\\nRUN FAILED: %s, ', err, '\\n%s\\n'); }" % (value, key, '#' * 80, key, '#' * 80) print "try { %s internal.output('RUN SUCCEEDED: %s\\n'); } catch (err) { print('%s\\nRUN FAILED: %s, ', err, '\\n%s\\n'); }" % (value, key, '#' * 80, key, '#' * 80)
print "ArangoshRun['%s'] = output;" % key print "ArangoshRun['%s'] = output;" % key
if JS_DEBUG: if JS_DEBUG:
print "internal.output('%s', ':\\n', output, '\\n%s\\n');" % (key, '-' * 80) print "internal.output('%s', ':\\n', output, '\\n%s\\n');" % (key, '-' * 80)

View File

@ -796,6 +796,16 @@ bool RestDocumentHandler::checkDocument () {
/// ///
/// @RESTURLPARAM{document-handle,string,required} /// @RESTURLPARAM{document-handle,string,required}
/// ///
/// @RESTQUERYPARAMETERS
///
/// @RESTQUERYPARAM{rev,string,optional}
///
/// @RESTQUERYPARAM{policy,string,optional}
///
/// @RESTHEADERPARAMETERS
///
/// @RESTHEADERPARAM{If-Match,string,optional}
///
/// @RESTDESCRIPTION /// @RESTDESCRIPTION
/// Completely updates (i.e. replaces) the document identified by `document-handle`. /// Completely updates (i.e. replaces) the document identified by `document-handle`.
/// If the document exists and can be updated, then a `HTTP 201` is returned /// If the document exists and can be updated, then a `HTTP 201` is returned
@ -829,7 +839,7 @@ bool RestDocumentHandler::checkDocument () {
/// conditional replacements (i.e. replacements that will only be executed if /// conditional replacements (i.e. replacements that will only be executed if
/// the revision id found in the database matches the document revision id specified /// the revision id found in the database matches the document revision id specified
/// in the request): /// in the request):
/// - specifying the target revision in the `rev` URL parameter /// - specifying the target revision in the `rev` URL query parameter
/// - specifying the target revision in the `if-match` HTTP header /// - specifying the target revision in the `if-match` HTTP header
/// ///
/// Specifying a target revision is optional, however, if done, only one of the /// Specifying a target revision is optional, however, if done, only one of the
@ -844,13 +854,13 @@ bool RestDocumentHandler::checkDocument () {
/// @REST{PUT /_api/document/`document-handle`?rev=`etag`} /// @REST{PUT /_api/document/`document-handle`?rev=`etag`}
/// ///
/// If a target revision id is provided in the request (e.g. via the `etag` value /// If a target revision id is provided in the request (e.g. via the `etag` value
/// in the `rev` URL parameter above), ArangoDB will check that /// in the `rev` URL query parameter above), ArangoDB will check that
/// the revision id of the document found in the database is equal to the target /// the revision id of the document found in the database is equal to the target
/// revision id provided in the request. If there is a mismatch between the revision /// revision id provided in the request. If there is a mismatch between the revision
/// id, then by default a `HTTP 412` conflict is returned and no replacement is /// id, then by default a `HTTP 412` conflict is returned and no replacement is
/// performed. /// performed.
/// ///
/// The conditional update behavior can be overriden with the `policy` URL parameter: /// The conditional update behavior can be overriden with the `policy` URL query parameter:
/// ///
/// @REST{PUT /_api/document/`document-handle`?policy=`policy`} /// @REST{PUT /_api/document/`document-handle`?policy=`policy`}
/// ///
@ -984,6 +994,18 @@ bool RestDocumentHandler::replaceDocument () {
/// ///
/// @RESTURLPARAM{document-handle,string,required} /// @RESTURLPARAM{document-handle,string,required}
/// ///
/// @RESTQUERYPARAMETERS
///
/// @RESTQUERYPARAM{keepNull,string,required}
///
/// @RESTQUERYPARAM{rev,string,optional}
///
/// @RESTQUERYPARAM{policy,string,optional}
///
/// @RESTHEADERPARAMETERS
///
/// @RESTHEADERPARAM{If-Match,string,optional}
///
/// @RESTDESCRIPTION /// @RESTDESCRIPTION
/// Partially updates the document identified by `document-handle`. /// Partially updates the document identified by `document-handle`.
/// The body of the request must contain a JSON document with the attributes /// The body of the request must contain a JSON document with the attributes
@ -993,7 +1015,7 @@ bool RestDocumentHandler::replaceDocument () {
/// ///
/// Setting an attribute value to `null` in the patch document will cause a /// Setting an attribute value to `null` in the patch document will cause a
/// value of `null` be saved for the attribute by default. If the intention /// value of `null` be saved for the attribute by default. If the intention
/// is to delete existing attributes with the patch command, the URL parameter /// is to delete existing attributes with the patch command, the URL query parameter
/// `keepNull` can be used with a value of `false`. /// `keepNull` can be used with a value of `false`.
/// This will modify the behavior of the patch command to remove any attributes /// This will modify the behavior of the patch command to remove any attributes
/// from the existing document that are contained in the patch document with an /// from the existing document that are contained in the patch document with an
@ -1203,6 +1225,16 @@ bool RestDocumentHandler::modifyDocument (bool isPatch) {
/// ///
/// @RESTURLPARAM{document-handle,string,required} /// @RESTURLPARAM{document-handle,string,required}
/// ///
/// @RESTQUERYPARAMETERS
///
/// @RESTQUERYPARAM{rev,string,optional}
///
/// @RESTQUERYPARAM{policy,string,optional}
///
/// @RESTHEADERPARAMETERS
///
/// @RESTHEADERPARAM{If-Match,string,optional}
///
/// @RESTDESCRIPTION /// @RESTDESCRIPTION
/// Deletes the document identified by `document-handle`. If the document /// Deletes the document identified by `document-handle`. If the document
/// exists and could be deleted, then a `HTTP 200` is returned. /// exists and could be deleted, then a `HTTP 200` is returned.