Related to https://github.com/bugventure/jsen/issues/52
This will be a breaking change, and require changes to monocle-api and the applications using it.
diff --git a/lib/RequestRouter.js b/lib/RequestRouter.js
index e981568..822bcf4 100644
--- a/lib/RequestRouter.js
+++ b/lib/RequestRouter.js
@@ -209,6 +209,10 @@ function cleanParamKey(key) {
function castParam(key, value, type) {
var hasTypeError = false;
+ if (!type || !type.indexOf) {
+ // Type is not string or array?
+ return value;
+ }
if (type.indexOf('boolean') !== -1) {
switch(value) {
diff --git a/test/lib/Router_test.js b/test/lib/Router_test.js
index 9bae87f..7468d34 100644
--- a/test/lib/Router_test.js
+++ b/test/lib/Router_test.js
@@ -805,7 +805,7 @@ describe('API Router', function() {
this.meeSchema = {
type: 'object',
properties: {
- floatParam: {type: 'float'}
+ floatParam: {type: 'number'}
}
};
@@ -1712,7 +1712,7 @@ describe('API Router', function() {
}
},
param4: {type: 'integer'},
- param5: {type: 'date-time'}
+ param5: {format: 'date-time'}
}
};
this.postObjSpy = sinon.spy(function(request, connection) {
Related to
https://github.com/bugventure/jsen/issues/52This will be a breaking change, and require changes to monocle-api and the applications using it.