@travetto/schema
Advanced tools
Comparing version 0.2.0 to 0.2.2
@@ -1,3 +0,3 @@ | ||
require('@travetto/base/bin/travetto').run() | ||
.then(x => { | ||
require('@travetto/base/bin/travetto') | ||
.run(x => { | ||
require('./watch'); | ||
@@ -4,0 +4,0 @@ require('../src').SchemaRegistry.onFieldChange((e) => { |
import { Request, Response } from 'express'; | ||
import * as qs from 'querystring'; | ||
@@ -82,3 +81,2 @@ import { ControllerRegistry, AppError, ParamConfig } from '@travetto/express'; | ||
const params = schemaToParams(cls, view); | ||
console.log(params); | ||
@@ -89,3 +87,3 @@ ControllerRegistry.registerPendingEndpoint(target.constructor, descriptor, { | ||
async (req: Request, res: Response) => { | ||
const o = getBound(cls, BindUtil.expandPaths(qs.parse(req.query)), view); | ||
const o = getBound(cls, BindUtil.expandPaths(req.query), view); | ||
if (SchemaRegistry.has(cls)) { | ||
@@ -92,0 +90,0 @@ req.query = await SchemaValidator.validate(o, view); |
@@ -7,8 +7,8 @@ { | ||
"dependencies": { | ||
"@travetto/config": "^0.2.0", | ||
"@travetto/registry": "^0.2.0" | ||
"@travetto/config": "^0.2.2", | ||
"@travetto/registry": "^0.2.2" | ||
}, | ||
"description": "Data type registry for runtime validation, reflection and binding. ", | ||
"devDependencies": { | ||
"@travetto/test": "^0.2.0" | ||
"@travetto/test": "^0.2.2" | ||
}, | ||
@@ -39,3 +39,4 @@ "optionalExtensionDependencies": { | ||
}, | ||
"version": "0.2.0" | ||
"version": "0.2.2", | ||
"gitHead": "14b93bc88216ca2baacfe20af1b0bd1b407b35b0" | ||
} |
import { Class } from '@travetto/registry'; | ||
import { ValidationError } from '@travetto/schema/src/service/validator'; | ||
import { ValidationError } from './service/validator'; | ||
@@ -4,0 +4,0 @@ export const DEFAULT_VIEW = '__all'; |
@@ -10,4 +10,5 @@ const proto = (Function as any)['__proto__']; | ||
export const init = { | ||
priority: -1, // Should be global | ||
key: 'schema', | ||
before: 'base', // Should be global | ||
action: () => proto.from = from // Register global from | ||
}; |
@@ -145,3 +145,5 @@ import { TransformUtil, TransformerState } from '@travetto/compiler'; | ||
}), visitNode), | ||
key: 'schema', | ||
after: 'registry', | ||
phase: 'before' | ||
}; |
58505
33
1573
Updated@travetto/config@^0.2.2
Updated@travetto/registry@^0.2.2