|
| 1 | +## (2024-09-18) |
| 2 | + |
| 3 | +* fix: upgrade @types/multer from 1.4.11 to 1.4.12 (#983) ([0fa043e](https://github.com/cdimascio/express-openapi-validator/commit/0fa043e)), closes [#983](https://github.com/cdimascio/express-openapi-validator/issues/983) |
| 4 | +* feat(path-to-regexp): path-to-regexp 8.1.0 update (#976) ([70cce65](https://github.com/cdimascio/express-openapi-validator/commit/70cce65)), closes [#976](https://github.com/cdimascio/express-openapi-validator/issues/976) |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | +## (2024-09-13) |
| 9 | + |
| 10 | +* bodyParsers is deprecated so update with expess bodyParsers (#974) ([6dc3b97](https://github.com/cdimascio/express-openapi-validator/commit/6dc3b97)), closes [#974](https://github.com/cdimascio/express-openapi-validator/issues/974) |
| 11 | +* Update README.md ([772d1dc](https://github.com/cdimascio/express-openapi-validator/commit/772d1dc)) |
| 12 | +* Update README.md ([de4219e](https://github.com/cdimascio/express-openapi-validator/commit/de4219e)) |
| 13 | +* fix: upgrade express-openapi-validator from 5.2.0 to 5.3.1 (#960) ([bd636bb](https://github.com/cdimascio/express-openapi-validator/commit/bd636bb)), closes [#960](https://github.com/cdimascio/express-openapi-validator/issues/960) |
| 14 | +* chore(deps-dev): bump braces from 3.0.2 to 3.0.3 in /examples/9-nestjs (#964) ([148fa90](https://github.com/cdimascio/express-openapi-validator/commit/148fa90)), closes [#964](https://github.com/cdimascio/express-openapi-validator/issues/964) |
| 15 | +* chore(deps-dev): bump braces in /examples/7-response-date-serialization (#963) ([aa3018a](https://github.com/cdimascio/express-openapi-validator/commit/aa3018a)), closes [#963](https://github.com/cdimascio/express-openapi-validator/issues/963) |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +## (2024-09-06) |
| 20 | + |
| 21 | +* fix: Dereference path parameters (#962) ([0aebe5d](https://github.com/cdimascio/express-openapi-validator/commit/0aebe5d)), closes [#962](https://github.com/cdimascio/express-openapi-validator/issues/962) |
| 22 | +* fix: upgrade express-openapi-validator from 5.2.0 to 5.3.1 (#951) ([5b0058d](https://github.com/cdimascio/express-openapi-validator/commit/5b0058d)), closes [#951](https://github.com/cdimascio/express-openapi-validator/issues/951) |
| 23 | +* [StepSecurity] ci: Harden GitHub Actions (#959) ([78e55be](https://github.com/cdimascio/express-openapi-validator/commit/78e55be)), closes [#959](https://github.com/cdimascio/express-openapi-validator/issues/959) |
| 24 | +* Fix changelog breaking changes notice (#961) ([0a8dc2f](https://github.com/cdimascio/express-openapi-validator/commit/0a8dc2f)), closes [#961](https://github.com/cdimascio/express-openapi-validator/issues/961) |
| 25 | +* update README ([7334ccd](https://github.com/cdimascio/express-openapi-validator/commit/7334ccd)) |
| 26 | +* chore(deps-dev): bump braces in /examples/5-custom-operation-resolver (#958) ([eda5612](https://github.com/cdimascio/express-openapi-validator/commit/eda5612)), closes [#958](https://github.com/cdimascio/express-openapi-validator/issues/958) |
| 27 | +* chore(deps): bump braces in /examples/4-eov-operations-babel (#957) ([749a8c8](https://github.com/cdimascio/express-openapi-validator/commit/749a8c8)), closes [#957](https://github.com/cdimascio/express-openapi-validator/issues/957) |
| 28 | +* chore(deps): bump webpack and @nestjs/cli in /examples/9-nestjs (#953) ([299aad6](https://github.com/cdimascio/express-openapi-validator/commit/299aad6)), closes [#953](https://github.com/cdimascio/express-openapi-validator/issues/953) |
| 29 | + |
| 30 | + |
| 31 | + |
1 | 32 | ## (2024-08-31) |
2 | 33 |
|
3 | 34 | * Change AJV allErrors default and support user setting (#955) ([392f1dd](https://github.com/cdimascio/express-openapi-validator/commit/392f1dd)), closes [#955](https://github.com/cdimascio/express-openapi-validator/issues/955) [#954](https://github.com/cdimascio/express-openapi-validator/issues/954) |
|
7 | 38 |
|
8 | 39 | ### breaking change |
9 | 40 |
|
10 | | -* by defaulting to `true` when not defined by the user. |
11 | | - |
12 | | -Add tests: |
13 | | -1. Make sure `AjvOptions` sets the value appropriately based on whether |
14 | | - the end user defined `allErrors` or not. |
15 | | -2. When validating requests, make sure the number of errors reported |
16 | | - (when multiple occur) is 1 when `allErrors` is `false`. |
17 | | - |
18 | | -The `allErrors` configuration for OpenAPISchemaValidator is not changed |
19 | | -by this commit since that validation is for trusted content. |
| 41 | +By default, request and response validation now stops after the first failure. Only one error will be reported even when multiple may exist. This follows best practices from AJV: |
| 42 | +- [Security risks of trusted schemas](https://ajv.js.org/security.html#security-risks-of-trusted-schemas) |
| 43 | +- [`allErrors` option](https://ajv.js.org/options.html#allerrors) |
| 44 | + |
| 45 | +To report all validation errors (only recommended in development), option `allErrors` can be set in options `validateRequests` and/or `validateResponses`. For example: |
| 46 | + |
| 47 | +```ts |
| 48 | +app.use( |
| 49 | + OpenApiValidator.middleware({ |
| 50 | + apiSpec: 'path/to/openapi.json', |
| 51 | + validateRequests: { |
| 52 | + allErrors: true, |
| 53 | + }, |
| 54 | + validateResponses: { |
| 55 | + allErrors: true, |
| 56 | + }, |
| 57 | + }) |
| 58 | +); |
| 59 | +``` |
20 | 60 |
|
21 | 61 |
|
22 | 62 | ## (2024-08-24) |
|
0 commit comments