You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/faq.md
+14-2Lines changed: 14 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,8 +31,20 @@ A path like `/files/some/long/path` will pass validation. The Express `req.param
31
31
32
32
### **Q:** Can I use discriminators with `oneOf` and `anyOf`?
33
33
34
-
Currently, there is support for top level discriminators. See [top-level discriminator example](https://github.com/cdimascio/express-openapi-validator/tree/master/examples/8-top-level-discriminator)
35
-
34
+
- By default, only **top-level discriminators** are supported. See the [top-level discriminator example](https://github.com/cdimascio/express-openapi-validator/tree/master/examples/8-top-level-discriminator).
35
+
- To also enable **deep discriminator** support (nested within `oneOf` / `anyOf`), set the `discriminator` option under `validateRequests`:
36
+
37
+
```js
38
+
app.use(
39
+
OpenApiValidator.middleware({
40
+
apiSpec,
41
+
validateRequests: {
42
+
discriminator:true,
43
+
//... other options
44
+
}
45
+
})
46
+
);
47
+
```
36
48
---
37
49
38
50
### **Q:** What happened to the `securityHandlers` property?
0 commit comments