Stopped overriding the ping method provided by the 1.0 API, but it didn't match the "castExists" regex so...
Fixed the lack of castExists for ping/1.0 by removing castExists all together from the API. It was the case anyway that all HEAD requests needed to be cast, so now the clientAction module will set that param when the spec is set to make HEAD requests. The transport.request still expects that parameter. Switched the apiVersion implementation to use funcEnum, and exposed the options on the Client constructor. Docs to come.
This commit is contained in:
@ -9,7 +9,6 @@ module.exports = function (branch, done) {
|
||||
var chalk = require('chalk');
|
||||
var path = require('path');
|
||||
var templates = require('./templates');
|
||||
var castExistsRE = /exists/;
|
||||
var usesBulkBodyRE = /^(bulk|msearch)$/;
|
||||
var urlParamRE = /\{(\w+)\}/g;
|
||||
|
||||
@ -167,10 +166,6 @@ module.exports = function (branch, done) {
|
||||
spec.bulkBody = true;
|
||||
}
|
||||
|
||||
if (castExistsRE.test(name)) {
|
||||
spec.castExists = true;
|
||||
}
|
||||
|
||||
var urls = _.difference(def.url.paths, aliases[name]);
|
||||
var urlSignatures = [];
|
||||
urls = _.map(urls, function (url) {
|
||||
@ -240,9 +235,7 @@ module.exports = function (branch, done) {
|
||||
'url',
|
||||
'urls',
|
||||
'needBody',
|
||||
'bulkBody',
|
||||
'castExists',
|
||||
'castNotFound'
|
||||
'bulkBody'
|
||||
]),
|
||||
location: location,
|
||||
docUrl: def.documentation,
|
||||
@ -283,11 +276,7 @@ module.exports = function (branch, done) {
|
||||
method = 'POST';
|
||||
}
|
||||
else if (methodsAre('GET', 'HEAD')) {
|
||||
if (action.spec.castExists) {
|
||||
method = 'HEAD';
|
||||
} else {
|
||||
method = 'GET';
|
||||
}
|
||||
method = 'GET';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user