Skip to content

Commit 380520d

Browse files
author
carmine
committed
Merge branch 'master' into oas3.1
2 parents e3daa22 + 8ce7fda commit 380520d

File tree

28 files changed

+5657
-2888
lines changed

28 files changed

+5657
-2888
lines changed

.github/workflows/default.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Build and Test
22

33
on: [push, pull_request]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
build:
710
runs-on: ubuntu-latest

CHANGE_HISTORY.md

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
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+
132
## (2024-08-31)
233

334
* 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,16 +38,25 @@
738

839
### breaking change
940

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+
```
2060

2161

2262
## (2024-08-24)

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@
3535
```shell
3636
npm install express-openapi-validator
3737

38-
# experimental OAS 3.1 in alpha (contributions welcome - see branch `oas-3.1` and pr-882)
39-
npm install [email protected]
38+
# experimental OAS 3.1 in alpha (contributions welcome - see branch `oas-3.1` and pr-882
39+
# please provide feedback on (issue-573)
40+
npm install [email protected]
4041
```
4142

4243
## Usage

0 commit comments

Comments
 (0)