mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 10:23:14 -04:00
**Bug** Calling `/api/osquery/saved_queries` with `sortOrder` but without `sort` field (`/api/osquery/saved_queries?sortOrder=desc`) was causing 500 server error. Same with calls without any parameters (`/api/osquery/saved_queries`) **Cause** We had defaults failover set for `sortOrder` but not for `sort`. Sorting logic required both fields to be defined. All schema params were set to optional and we were validating them ourselves. **Fix** I've tightened the schema by making all the params required and provided default values if not provided. `page: schema.number({ defaultValue: 1 }), sort: schema.string({ defaultValue: 'id' }), sortOrder: schema.oneOf([schema.literal('asc'), schema.literal('desc')], {defaultValue: 'desc',}),` **Additionally** Outdated osQuery API docs - `perPage` became `pageSize` and `sortField` became `sort`. Also, minor spelling fixes. --------- Co-authored-by: Patryk Kopyciński <contact@patrykkopycinski.com> |
||
---|---|---|
.. | ||
create.asciidoc | ||
delete.asciidoc | ||
get-all.asciidoc | ||
get.asciidoc | ||
update.asciidoc |