Yusuke Wada
0da78351e9
feat(validator): has the error message per rule ( #603 )
...
* feat(validator): has the error message per rule
* add test for checking result objects
* test(validator): add array results test (#609 )
* remove `console.log`
Co-authored-by: Derrick Farris <mr.dcfarris@gmail.com>
2022-10-19 19:17:04 +09:00
Yusuke Wada
2776957bba
feat(validator): introduce nested validation ( #592 )
...
* feat(validator): introduce `v.array()` and `v.object` for nested validation
* copy objects
* remove unnecessary tests
* fix(object): make merge immutable to fix issues with missing fields (#598 )
Co-authored-by: Derrick Farris <mr.dcfarris@gmail.com>
2022-10-13 06:48:59 +09:00
Derrick Farris
1adc9264fc
fix(validator): return HTTP 400 on malformed JSON request ( #579 )
...
* fix(validator): return http 400 on malformed JSON request
* chore(deno): denoify malformed json changes
2022-10-04 06:16:25 +09:00
Derrick Farris
9a0389e723
feat(validator): add support for JSON array path validation ( #563 )
...
* refactor(JSONPath): improve typing of JSONPath
* chore(vscode-settings): add deno.enable=false
* fix(validator): add null to type Type def
* feat(JSON-Path): add support for array JSONPath-Plus syntax
* fix(validator): update isRequired to pass valid bool types
* test: update tests for isRequired validator
* feat(validator): add support for JSON array path validation
* chore(deno): denoify array support changes
* fix(validator): type check all vals in array
* chore(deno): denoify changes
* test(validator): add tests for array type checking
* fix(validator): change JSONPrimative to JSONPrimitive
* refactor(json): More compatible with https://jsonpath.com/ .
* implementation of `asArray`
* fix(validator): update JSONPath implementation and add isArray check in validation
* fix(validator): fix typing errors on SchemaToProp
* Revert "fix(validator): fix typing errors on SchemaToProp"
This reverts commit b8ddef85d0
.
* fix(validator): fix SchemaToProp error for VTypeArrays
* chore(deno): denoify
Co-authored-by: Taku Amano <taku@taaas.jp>
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2022-09-30 21:56:39 +09:00
Yusuke Wada
c0d88ff01c
fix(validator): make isOptional
rule works correctly. ( #555 )
2022-09-27 18:19:50 +09:00
Yusuke Wada
84451d61e1
fix(types): enable types for c.env
when using validator ( #553 )
2022-09-26 21:18:48 +09:00
Taku Amano
957a5a9ac9
feat(validator): Enable verification results to be retrieved as structured data. ( #547 )
...
* feat(validator): Enable verification results to be retrieved as structured data.
* chore: denoify
2022-09-21 09:40:17 +09:00
Yusuke Wada
594f30aa35
fix(validator): make "Types" work well ( #545 )
...
* fix(validator): make "Types" work well
* fix import statement
2022-09-21 07:55:29 +09:00
Yusuke Wada
a2cc1a01c2
feat: another idea of Validator Middleware ( #535 )
...
* feat: Another idea of validator middleware
* denoify
* set property value in constructor
* rename `option` to `options`
* add test for handling type error
* use `test` instead of `match`
2022-09-20 10:11:34 +09:00
Yusuke Wada
9c9e1c2356
feat(validator): add isBoolean
and isNumber
( #530 )
2022-09-16 00:10:37 +09:00
Yusuke Wada
62e3292460
feat(validator): add isFalsy
and isNotFalsy
( #523 )
2022-09-14 08:30:46 +09:00
Yusuke Wada
e2d704fd4f
fix(types): add types to middleware correctly ( #521 )
2022-09-14 08:17:20 +09:00
Yusuke Wada
46c6a8de5e
feat(middleware): introduce "built-in" Validator Middleware ( #505 )
...
* feat(middleware): introduce built-in Validator Middleware
* fixed type of `req.json()`
* Feat/builtin validator middleware another idea (#508 )
* Enable overwriting of query/header data.
* Returns only verified data.
* rename `index.test.ts` to `middleware.test.ts`
* add `removeAdditional` option
* handling error that the JSON body is null
* tidy
* check is it string or not
* implement `isIn`
* enable validation the valies are duplicate
Co-authored-by: Taku Amano <taku@taaas.jp>
2022-09-13 07:54:06 +09:00