Skip to content

Commit

Permalink
Updated faq with information about qs validator
Browse files Browse the repository at this point in the history
  • Loading branch information
helios-ag committed Nov 5, 2024
1 parent b2ad6e9 commit d586de4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,21 @@ export interface MyModel {
## How can I get the most from my OAS?

Now that you have a OpenAPI Specification (OAS) (swagger.json), you can use all kinds of amazing tools that generate documentation, client SDKs, and more [here](http://openapi.tools).

## How to override limit for validating large arrays (with more than 20 elements)

By default [Express](https://github.com/expressjs/express) uses [qs](https://github.com/ljharb/qs) as parser internally, and its have default limitation for validating 20 elements in array
to override this you must add following configuration to your express config:

```ts
const app = express();

app.set('query parser', function(str) {
return qs.parse(str, { arrayLimit: Infinity });
});

app.use(bodyParser.json())
app.use(Router())
```

Please note that you must place it on top of other middleware.

0 comments on commit d586de4

Please sign in to comment.