Mobrovac has submitted this change and it was merged.
Change subject: Update restbase to 5e8112a
......................................................................
Update restbase to 5e8112a
List of changes:
76fe932 Fix swagger spec
b9184a2 Minor: Make server.js executable
c1c9c45 Minor: Switch to swagger-router 0.3.1
xxxxxxx Update node module dependencies
Change-Id: I7a70f80d6ef501943712a96315286bd5f9cc1a8f
---
M
node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/async/package.json
M
node_modules/restbase-mod-table-cassandra/node_modules/restbase-mod-table-spec/node_modules/routeswitch/node_modules/async/package.json
M node_modules/swagger-router/.jshintrc
A node_modules/swagger-router/.npmignore
A node_modules/swagger-router/config.example.yaml
A node_modules/swagger-router/interfaces/mediawiki-content.yaml
M node_modules/swagger-router/lib/node.js
M node_modules/swagger-router/lib/reqTemplate.js
M node_modules/swagger-router/package.json
M node_modules/swagger-router/test/features/reqTemplate.js
M restbase
11 files changed, 510 insertions(+), 33 deletions(-)
Approvals:
Mobrovac: Verified; Looks good to me, approved
diff --git
a/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/async/package.json
b/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/async/package.json
index 34c2887..062a245 100644
---
a/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/async/package.json
+++
b/node_modules/restbase-mod-table-cassandra/node_modules/cassandra-driver/node_modules/async/package.json
@@ -79,5 +79,6 @@
"tarball": "http://registry.npmjs.org/async/-/async-0.9.2.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz"
+ "_resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git
a/node_modules/restbase-mod-table-cassandra/node_modules/restbase-mod-table-spec/node_modules/routeswitch/node_modules/async/package.json
b/node_modules/restbase-mod-table-cassandra/node_modules/restbase-mod-table-spec/node_modules/routeswitch/node_modules/async/package.json
index 37f1cb0..76d5799 100644
---
a/node_modules/restbase-mod-table-cassandra/node_modules/restbase-mod-table-spec/node_modules/routeswitch/node_modules/async/package.json
+++
b/node_modules/restbase-mod-table-cassandra/node_modules/restbase-mod-table-spec/node_modules/routeswitch/node_modules/async/package.json
@@ -79,6 +79,5 @@
"tarball": "http://registry.npmjs.org/async/-/async-0.9.2.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz"
}
diff --git a/node_modules/swagger-router/.jshintrc
b/node_modules/swagger-router/.jshintrc
index 2fbd02d..3441c48 100644
--- a/node_modules/swagger-router/.jshintrc
+++ b/node_modules/swagger-router/.jshintrc
@@ -11,7 +11,7 @@
"curly": true,
"eqeqeq": true,
"immed": true,
- "latedef": true,
+ "latedef": "nofunc",
"newcap": true,
"noarg": true,
"noempty": true,
diff --git a/node_modules/swagger-router/.npmignore
b/node_modules/swagger-router/.npmignore
new file mode 100644
index 0000000..7623cfa
--- /dev/null
+++ b/node_modules/swagger-router/.npmignore
@@ -0,0 +1,4 @@
+coverage/
+node_modules
+.idea/*
+*.iml
diff --git a/node_modules/swagger-router/config.example.yaml
b/node_modules/swagger-router/config.example.yaml
new file mode 100644
index 0000000..bc806bf
--- /dev/null
+++ b/node_modules/swagger-router/config.example.yaml
@@ -0,0 +1,156 @@
+# RESTBase config
+
+port: 7231
+
+# System domain (used to store restbase metadata)
+sysdomain: restbase.local
+
+templates:
+ wmf-content-1.0.0: &wp/content/1.0.0
+ swagger: '2.0'
+ # swagger options, overriding the shared ones from the merged specs (?)
+ info:
+ version: 1.0.0-abcd
+ title: Standard Wikimedia content API
+ description: All the content for this domain.
+ termsOfService: http://wikimedia.org/terms/
+ contact:
+ name: The project maintainers
+ url: http://mediawiki.org/wiki/RESTBase
+ license:
+ name: Creative Commons 4.0 International
+ url: http://creativecommons.org/licenses/by/4.0/
+ security:
+ # ACLs for public *.wikipedia.org wikis
+ - mediaWikiAuth:
+ - user:read
+ paths:
+ /v1:
+ x-restbase:
+ interfaces:
+ - mediawiki-content
+ # - mediawiki/v1/content
+ # - mediawiki/v1/mobile
+ # - mediawiki/v1/revision-scoring
+
+ x-restbase-paths: # Internal paths. These use the same config structure as
+ # regular paths, but are restricted to internal use and
+ # don't show up in swagger.
+ #
+ # This stanza defines the /{domain}/sys/ hierarchy.
+
+ /sys/table: &wp/sys/table # Can use this anchor to share the table
+ # backend even if other parts differ
+ x-restbase:
+ interfaces:
+ - restbase/sys/table
+ modules:
+ # There can be multiple modules too per stanza, as long as the
+ # exported symbols don't conflict. The operationIds from the spec
+ # will be resolved against all of the modules.
+ - name: restbase-cassandra
+ version: 1.0.0
+ type: npm
+ options: # Passed to the module constructor
+ hosts: [localhost]
+ keyspace: system
+ username: cassandra
+ password: cassandra
+ defaultConsistency: localQuorum # or 'one' for single-node
testing
+
+ /sys/page_revisions: &wp-page-revisions
+ x-restbase:
+ interfaces:
+ - mediawiki/sys/page_revisions
+ modules:
+ - name: restbase-mod-page_revisions
+ version: 1.0.0
+ type: npm
+ options:
+ apiURL: http://{domain}/w/api.php
+
+ /sys/key_rev_value: &wp/sys/key_rev_value
+ x-restbase:
+ interfaces:
+ - restbase/sys/key_rev_value
+ modules:
+ - name: restbase-mod-key_rev_value
+ version: 1.0.0
+ type: npm
+
+ /sys/parsoid:
+ x-restbase:
+ interfaces:
+ - mediawiki/sys/parsoid
+ modules:
+ - name: restbase-mod-parsoid
+ version: 1.0.0
+ type: npm
+ options:
+ parsoidHost: http://parsoid-lb.wikimedia.org
+ apiURL: http://{domain}/w/api.php
+ resources:
+ # Storage owned by this module. Created / checked after setting up
+ # all modules (separate traversal).
+ # Convention: Prefix each entry with the owning sys path to avoid
+ # conflicts.
+ - uri: /{domain}/sys/key_rev_value/parsoid.html
+ - uri: /{domain}/sys/key_rev_value/parsoid.data-parsoid
+ - uri: /{domain}/sys/key_rev_value/parsoid.data-mw
+ - uri: /{domain}/sys/key_rev_value/parsoid.wikitext
+
+ /sys/revscore:
+ title: Simple revscore service wrapper
+ x-restbase:
+ # Generic revision service interface; Expects requests of the form
+ # /{title}/{revision}.
+ # Specific interface documentation (content types etc) at public
+ # entry point, although we might also want to enforce them
+ # internally.
+ interfaces:
+ - restbase/sys/key_rev_service
+ modules:
+ - name: restbase-mod-service
+ version: 1.0.0 # simple service module, to be shared
+ options:
+ storage:
+ uri:
/{domain}/sys/key_rev_value/revscore.scores/{title}/{revision}
+ service:
+ uri:
http://revscore.wikimedia.org/{domain}/{title}/{revision}
+ resources:
+ - uri: /{domain}/sys/key_rev_value/revscore.scores
+
+
+
+spec:
+ title: "The RESTBase root"
+ # Some more general RESTBase info
+ paths:
+ /{domain:en.wikipedia.org}:
+ x-restbase:
+ interfaces:
+ - *wp/content/1.0.0
+ /{domain:de.wikipedia.org}:
+ x-restbase:
+ interfaces:
+ - *wp/content/1.0.0
+ /{domain:es.wikipedia.org}:
+ x-restbase:
+ interfaces:
+ - *wp/content/1.0.0
+ /{domain:nl.wikipedia.org}:
+ x-restbase:
+ interfaces:
+ - *wp/content/1.0.0
+
+
+logging:
+ name: restbase
+ #streams:
+ ## XXX: Use gelf-stream -> logstash
+ #- type: gelf
+ # host: <%= @logstash_host %>
+ # port: <%= @logstash_port %>
+
+monitoring:
+ # statsdHost: localhost
diff --git a/node_modules/swagger-router/interfaces/mediawiki-content.yaml
b/node_modules/swagger-router/interfaces/mediawiki-content.yaml
new file mode 100644
index 0000000..a7965ed
--- /dev/null
+++ b/node_modules/swagger-router/interfaces/mediawiki-content.yaml
@@ -0,0 +1,245 @@
+swagger: '2.0'
+info:
+ version: '1.0.0'
+ title: mediawiki content api
+ description: basic mediawiki content api.
+ termsofservice: https://github.com/wikimedia/restbase#restbase
+ contact:
+ name: services
+ email: [email protected]
+ url: https://www.mediawiki.org/wiki/services
+ license:
+ name: gnu affero
+ url: http://opensource.org/licenses/agpl-3.0
+
+paths:
+
+ /page/{title}/html:
+ get:
+ tags:
+ - page content
+ description: redirects to the latest html
+ operationid: getlatestformat
+ parameters:
+ - name: domain
+ in: path
+ description: the domain under which the data resides
+ type: string
+ required: true
+ default: en.wikipedia.org
+ - name: title
+ in: path
+ description: the title of page content
+ type: string
+ required: true
+ responses:
+ '302':
+ description: redirection to the latest html
+ '404':
+ description: unknown table, bucket, or domain
+ schema:
+ $ref: '#/definitions/notfound'
+ default:
+ description: unexpected error
+ schema:
+ $ref: '#/definitions/defaulterror'
+ x-restbase:
+ service:
+ # Directly return the latest HTML. Alternatively, we could also try
+ # relative redirects. A relative location header of 'foo/bar' seems
to
+ # work in current Chrome and Firefox.
+ # See also http://tools.ietf.org/html/rfc7231#section-7.1.2
+ uri: /{domain}/sys/parsoid/html/{title}/latest
+
+ /page/{title}/html/:
+ get:
+ tags:
+ - Page content
+ description: Returns the list of revisions
+ operationId: listKeyRevValueRevisions
+ produces:
+ - application/json
+ parameters:
+ - name: domain
+ in: path
+ description: The domain under which the data resides
+ type: string
+ required: true
+ default: en.wikipedia.org
+ - name: title
+ in: path
+ description: The title of page content
+ type: string
+ required: true
+ responses:
+ '200':
+ description: The list of revisions
+ schema:
+ type: array
+ items:
+ $ref: '#/definitions/revisions'
+ default:
+ description: Unexpected error
+ schema:
+ $ref: '#/definitions/defaultError'
+ x-restbase:
+ service:
+ uri: /{domain}/sys/parsoid/html/{title}/
+
+ /page/{title}/data-parsoid/{revision}:
+ get:
+ tags:
+ - Page content
+ description: Returns the Parsoid data for the given revision
+ operationId: getFormatRevision
+ produces:
+ - text/html
+ parameters:
+ - name: domain
+ in: path
+ description: The domain under which the data resides'
+ type: string
+ required: true
+ default: en.wikipedia.org
+ - name: title
+ in: path
+ description: The title of page content
+ type: string
+ required: true
+ - name: revision
+ in: path
+ description: The revision
+ type: string
+ required: true
+ responses:
+ '200':
+ description: The latest Parsoid data for the given page
+ '400':
+ description: Invalid revision
+ schema:
+ $ref: '#/definitions/invalidRevision'
+ '404':
+ description: Unknown table, bucket, page, or domain
+ schema:
+ $ref: '#/definitions/notFound'
+ default:
+ description: Unexpected error
+ schema:
+ $ref: '#/definitions/defaultError'
+ x-restbase:
+ service:
+ uri: /{domain}/sys/parsoid/data-parsoid/{title}/{revision}
+ headers:
+ cache-control: $req.headers.cache-control
+
+
+ /page/{title}/html/{revision}:
+ get:
+ tags:
+ - Page content
+ description: Returns the html for the given revision
+ operationId: getFormatRevision
+ produces:
+ - text/html
+ parameters:
+ - name: domain
+ in: path
+ description: The domain under which the data resides'
+ type: string
+ required: true
+ default: en.wikipedia.org
+ - name: title
+ in: path
+ description: The title of page content
+ type: string
+ required: true
+ - name: revision
+ in: path
+ description: The revision
+ type: string
+ required: true
+ responses:
+ '200':
+ description: The latest html for the given page
+ '400':
+ description: Invalid revision
+ schema:
+ $ref: '#/definitions/invalidRevision'
+ '404':
+ description: Unknown table, bucket, page, or domain
+ schema:
+ $ref: '#/definitions/notFound'
+ default:
+ description: Unexpected error
+ schema:
+ $ref: '#/definitions/defaultError'
+ x-restbase:
+ service:
+ uri: /{domain}/sys/parsoid/html/{title}/{revision}
+ headers:
+ cache-control: $req.headers.cache-control
+
+
+definitions:
+ defaultError:
+ required:
+ - code
+ - message
+ properties:
+ code:
+ type: integer
+ format: int32
+ message:
+ type: string
+ invalidRevision:
+ required:
+ - code
+ - method
+ - title
+ - type
+ - uri
+ properties:
+ code:
+ type: integer
+ format: int32
+ method:
+ type: string
+ title:
+ type: string
+ type:
+ type: string
+ uri:
+ type: string
+ notFound:
+ required:
+ - code
+ - method
+ - title
+ - type
+ - uri
+ properties:
+ code:
+ type: integer
+ format: int32
+ type:
+ type: string
+ title:
+ type: string
+ description:
+ type: string
+ localURI:
+ type: string
+ table:
+ type: string
+ uri:
+ type: string
+ method:
+ type: string
+ revisions:
+ required:
+ - items
+ properties:
+ items:
+ type: array
+ items:
+ type: string
diff --git a/node_modules/swagger-router/lib/node.js
b/node_modules/swagger-router/lib/node.js
index 18e81ec..99100fe 100644
--- a/node_modules/swagger-router/lib/node.js
+++ b/node_modules/swagger-router/lib/node.js
@@ -109,6 +109,7 @@
Node.prototype.clone = function() {
var c = new Node();
c._children = this._children;
+ c._paramName = this._paramName;
return c;
};
@@ -118,19 +119,20 @@
path = path || [];
var self = this;
// First value, then each of the children (one by one)
- var visitP = fn(self.value, path);
- if (Object.keys(self._children).length > 0) {
- Object.keys(self._children).forEach(function(childKey) {
- var segment = childKey[0] === '/' ? childKey.substr(1) : childKey;
+ return fn(self.value, path)
+ .then(function() {
+ return P.resolve(Object.keys(self._children))
+ .each(function(childKey) {
+ var segment = childKey.replace(/^\//, '');
var child = self._children[childKey];
- if (child !== self) {
- visitP = visitP.then(function() {
- return child.visitAsync(fn, path.concat([segment]));
- });
+ if (child === self) {
+ // Don't enter an infinite loop on **
+ return;
+ } else {
+ return child.visitAsync(fn, path.concat([segment]));
}
});
- }
- return visitP;
+ });
};
// Work around recursive structure in ** terminal nodes
@@ -147,7 +149,9 @@
newMethods[method] = '<' + val[method].name + '>';
});
res.methods = newMethods;
- } else {
+ // Omit the specRoot, as it tends to be huge & contains reference
+ // circles.
+ } else if (key !== 'specRoot') {
res[key] = val;
}
});
@@ -170,4 +174,5 @@
}
};
+
module.exports = Node;
diff --git a/node_modules/swagger-router/lib/reqTemplate.js
b/node_modules/swagger-router/lib/reqTemplate.js
index 44a8905..0880d54 100644
--- a/node_modules/swagger-router/lib/reqTemplate.js
+++ b/node_modules/swagger-router/lib/reqTemplate.js
@@ -10,6 +10,10 @@
ctxMap: {
$: 'rm',
$$: 'rc.g',
+ globals: 'rm',
+ // `global` is deprecated, as `globals` (plural) is more consistent
+ // with `options` & the code.
+ // TODO: Remove!
global: 'rm',
},
dottedPathPrefix: 'rm',
@@ -80,6 +84,13 @@
// TODO: Add support for
// - multiple predicates (via arguments)
// - function predicates
+ },
+
+ requestTemplate: function(spec, options) {
+ var tpl = new Template(spec, options);
+ return function(model) {
+ return tpl.expand(model);
+ };
},
// Private helpers
@@ -163,7 +174,7 @@
function compileTAssembly(template, reqPart, globals) {
var res = '';
var stringCb = function(bit) {
- if (bit) {
+ if (bit !== undefined && bit !== null) {
res += '' + bit;
}
};
@@ -174,7 +185,13 @@
cb: stringCb,
globals: globals || globalMethods,
};
- var resolveTemplate = TAssembly.compile(template, options);
+ try {
+ var resolveTemplate = TAssembly.compile(template, options);
+ } catch (e) {
+ e.template = template;
+ e.part = reqPart;
+ throw e;
+ }
return function(context) {
var childContext = {
@@ -183,7 +200,8 @@
g: options.globals,
options: context.options || options,
cb: options.cb,
- m: context.rm.request[reqPart],
+ m: (!reqPart && context.rm)
+ || (context.rm.request && context.rm.request[reqPart]),
};
resolveTemplate(childContext);
@@ -326,12 +344,21 @@
res = bit;
}
};
- var resolver = TAssembly.compile([['raw', completeTAssemblyTemplate]], {
- nestedTemplate: true,
- globals: globals,
- cb: objectCb,
- errorHandler: null,
- });
+
+ var resolver;
+ try {
+ resolver = TAssembly.compile([['raw', completeTAssemblyTemplate]], {
+ nestedTemplate: true,
+ globals: globals,
+ cb: objectCb,
+ errorHandler: null,
+ });
+ } catch (e) {
+ e.spec = origSpec;
+ e.tassembly = completeTAssemblyTemplate;
+ throw e;
+ }
+
var c = {
rc: null,
rm: null,
diff --git a/node_modules/swagger-router/package.json
b/node_modules/swagger-router/package.json
index 4bae2ff..f4b5dfe 100644
--- a/node_modules/swagger-router/package.json
+++ b/node_modules/swagger-router/package.json
@@ -1,6 +1,6 @@
{
"name": "swagger-router",
- "version": "0.2.9",
+ "version": "0.3.2",
"description": "An efficient swagger 2 based router with support for
multiple APIs. For use in RESTBase.",
"main": "index.js",
"scripts": {
@@ -11,7 +11,7 @@
},
"repository": {
"type": "git",
- "url": "https://github.com/gwicke/swagger-router.git"
+ "url": "git+https://github.com/gwicke/swagger-router.git"
},
"keywords": [
"swagger2",
@@ -42,10 +42,35 @@
"coveralls": "^2.11.2",
"mocha-jscs": "^1.2.0"
},
- "readme": "# Swagger 2
router\n[](https://travis-ci.org/wikimedia/swagger-router)\n\n##
Features\n- `O(path element)` lookup complexity, monomorphic design with
simple fast path.\n- Support for prefix-based 'mounting' of swagger specs.
Example: Mount the\n same spec fragments at `/en.wikipedia.org/v1/` and\n
`/de.wikipedia.org/v1/`.\n- Support for capture of fixed path segments.
Example:\n `/{domain:en.wikipedia.org}/v1/`. This feature is especially
useful in\n prefixes, as it enables the consistent construction of sensible
params.\n- Support for static (purely spec-based) listings. Matching requests
ending on\n a slash are passed an array of matching child paths in the spec
in the\n `_ls` parameter.\n\n## Installation\n`npm install
swagger-router`\n\n## Usage\n```javascript\nvar Router =
require('swagger-router');\nvar router = new Router();\n\n// The main
requirement is that each spec has a 'paths' member with some URL\n//
patterns\nvar swaggerSpec = {\n paths: {\n '/': {\n get:
{\n hello: 'A listing'\n }\n },\n
'/some/{name}': { // This object is returned as 'value'\n get: {\n
hello: 'world'\n }\n }\n
}\n};\n\nrouter.addSpec(swaggerSpec);\n\n// Perform some
lookups\nconsole.log(router.lookup('/some/title'));\n/* \n{\n params: {\n
name: 'title'\n },\n value: { get: { hello: 'world' } }\n}\n*/\n\n//
Use arrays internally for speed (no escaping /
parsing)\nrouter.lookup(['some','path']);\n\n// Trailing slashes set an
additional _ls param:\nrouter.lookup(['']); // equivalent: router.lookup('/');
\n/*\n{\n params: {\n _ls: ['some'],\n name: 'title'\n },\n
value: { get: { hello: 'A listing' } }\n}\n*/\n\n```\n## URI
templating\n\nURIs are represented by `URI` class, which supports a limited set
of features\nfrom [URI Template RFC 6570](http://tools.ietf.org/html/rfc6570).
\n\n### Supported URI template expressions:\n- Simple string expression
`{pattern}` - on expansion, looks up a variable named `pattern` in params\n
and substitutes its pct-encoded value. On matching, matches a single element in
the path, and\n sets `params.pattern` to the path element value. \n-
Restricted expression `{+pattern}` - on expansion, works the same way as simple
expression, but doesn't\n pct-encode [reserved
characters](http://tools.ietf.org/html/rfc3986#section-2.2) and ptc-triplets.\n
On matching, matches the whole subpath and writes it's value to
`params.pattern` variable.\n- Optional expression `{/pattern}` - works the same
way as simple expression, but on matching the path \n element is optional.\n-
Fixed expression `{pattern:value}` - on matching, matches only uris with path
element equal to `value`,\n and exports `value` as `params.pattern` variable.
On expansion, substitutes `value`.\n\nThese features are optimised and
available with `URI.expand(params)` method. Additional features\nare available
with request templating.\n\n## Request templating\n\nModule exports an
efficient templating library under `Template` class.\n\nExample
usage:\n```javascript\nvar template = new Template({\n method: 'put',\n
uri: '/{domain}/{$.request.headers.location}',\n headers:
'{$$.merge($.request.headers, {\"additional_name\": \"additional_value\"})}'\n
body: {\n field_from_req_body: '{field_name}',\n
global_reference: '{$.request.headers.header_name}',\n
field_with_default_value: '{$$.default($.request.params.param_name,
\"defaultValue\")}' \n }\n});\nvar request = template.expand({\n
request: req,\n additional_context: context\n});\n```\n\nExpressions wrapped
in curly braces are considered templates, which are resolved to values\non
template expansion. In case some value cannot be resolved, template is expanded
to `undefined`.\n\n`$` references global context (object, passed to the
`expand` method). It can contain arbitrary number of objects,\nbut it must at
least contain a `request` property with an original request. \n\nShort
notations are supported, which are resolved to fields of a request part, for
example, \n`'{field_name}'` in template `body` would be resolved to
`'{$.request.body.field_name}'`. \nShort notations in `uri` would be resolved
to `$.request.params`.\n\nBraced syntax is supported, so it's possible to write
templates like `'{$.request.body[$.request.params.some_field]}'`.\n\nSeveral
utility methods are supported:\n- `$$.default(template, defaultValue)` - if
`template` is resolved, use it's value, otherwise use `defaultValue`.\n-
`$$.merge(template1, template2)` - both templates should be evaluated to
objects. The result is an object\n with merged properties, but without
overriding.\n- `$$.strip(object, properties)` - removes field names listed in
`properties` array from an `object`. `properties`\n could also be a string,
if a single field should be removed.\n",
- "readmeFilename": "README.md",
- "_id": "[email protected]",
- "_shasum": "c87af0beb619367180c14f5bb7261994654d9e45",
- "_resolved":
"git+https://github.com/gwicke/swagger-router.git#1fbd46256633311d06e9307a0eaccbe6d1c624d1",
- "_from":
"swagger-router@git+https://github.com/gwicke/swagger-router.git#cleaner_expressions"
+ "gitHead": "3b0e51466aaf13a06aef5c1c1b59f97c57033156",
+ "homepage": "https://github.com/gwicke/swagger-router#readme",
+ "_id": "[email protected]",
+ "_shasum": "ff6cb110213997357400e6b197b70b361f8f8533",
+ "_from": "swagger-router@^0.3.1",
+ "_npmVersion": "2.14.3",
+ "_nodeVersion": "0.10.37",
+ "_npmUser": {
+ "name": "doorman",
+ "email": "[email protected]"
+ },
+ "maintainers": [
+ {
+ "name": "gwicke",
+ "email": "[email protected]"
+ },
+ {
+ "name": "pchelolo",
+ "email": "[email protected]"
+ },
+ {
+ "name": "doorman",
+ "email": "[email protected]"
+ }
+ ],
+ "dist": {
+ "shasum": "ff6cb110213997357400e6b197b70b361f8f8533",
+ "tarball":
"http://registry.npmjs.org/swagger-router/-/swagger-router-0.3.2.tgz"
+ },
+ "directories": {},
+ "_resolved":
"https://registry.npmjs.org/swagger-router/-/swagger-router-0.3.2.tgz"
}
diff --git a/node_modules/swagger-router/test/features/reqTemplate.js
b/node_modules/swagger-router/test/features/reqTemplate.js
index 6d041cb..46962a8 100644
--- a/node_modules/swagger-router/test/features/reqTemplate.js
+++ b/node_modules/swagger-router/test/features/reqTemplate.js
@@ -163,7 +163,6 @@
}
}
}).uri.toString();
- console.log(resultNoOptional);
assert.deepEqual(resultNoOptional, '/en.wikipedia.org/b/path');
var resultWithOptional = new Template(requestTemplate).expand({
request: {
@@ -468,4 +467,20 @@
}
});
});
+
+ it('should correctly resolve 0 value', function() {
+ var template = new Template({
+ headers: 'test_{test_header}'
+ });
+ var result = template.expand({
+ request: {
+ headers: {
+ test_header: 0
+ }
+ }
+ });
+ assert.deepEqual(result, {
+ headers: 'test_0'
+ });
+ });
});
diff --git a/restbase b/restbase
index 7ebaab4..5e8112a 160000
--- a/restbase
+++ b/restbase
-Subproject commit 7ebaab4a68f82bda306e087d611585c94d68f9c9
+Subproject commit 5e8112a7e7a2c5f5c4a48b19557e39b6a12374bf
--
To view, visit https://gerrit.wikimedia.org/r/256684
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7a70f80d6ef501943712a96315286bd5f9cc1a8f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/restbase/deploy
Gerrit-Branch: master
Gerrit-Owner: Mobrovac <[email protected]>
Gerrit-Reviewer: Mobrovac <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits