kibana/docs/api
Konrad Szwarc ee26923aab
[Defend Workflows] Fix saved queries 500 (#150426)
**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>
2023-02-14 16:11:14 +01:00
..
actions-and-connectors [DOCS] Create open API specification for run connector (#149274) 2023-01-26 08:53:47 -08:00
alerting [DOCS] Create open API specification for create rule (#149565) 2023-01-26 18:07:23 -08:00
cases [DOCS] Add assignees query parameter to find cases API (#146087) 2022-11-29 08:46:49 -08:00
dashboard [Security Solution] [Sourcerer] [Feature Branch] Update to use Kibana Data Views (#114806) 2021-11-04 14:51:32 -06:00
data-views [data views] Allow data view rename via rest api (#141869) 2022-09-27 06:56:46 -05:00
index-patterns [data views] Allow data view rename via rest api (#141869) 2022-09-27 06:56:46 -05:00
logstash-configuration-management Add a note that if list pipelines exceeds 10k, Kibana faces performan… (#131992) 2022-05-11 16:24:16 -07:00
machine-learning [DOCS] Link to open API specification from ML sync API (#142136) 2022-09-29 08:29:07 -07:00
osquery-manager [Defend Workflows] Fix saved queries 500 (#150426) 2023-02-14 16:11:14 +01:00
role-management Warn & Disallow Creating Role with Existing Name (#132218) 2022-05-25 08:34:41 -07:00
saved-objects API docs: Add deprecation warning to all deprecated Saved Object APIs (#150267) 2023-02-07 09:28:13 -07:00
session-management Expose session invalidation API. (#92376) 2021-03-24 09:54:08 +01:00
short-urls Short url docs (#113084) 2021-10-12 19:46:58 +02:00
spaces-management [Docs] Documents constraints of space id in create space API (#150379) 2023-02-06 16:31:35 -05:00
task-manager [Alerting][Docs] Support enablement documentation. (#101457) 2021-06-28 11:57:17 -07:00
upgrade-assistant Fixed some typos (#125802) 2022-03-02 16:40:34 -06:00
actions-and-connectors.asciidoc Add open API specification for list connector types (#145951) 2022-11-24 11:30:51 -07:00
alerting.asciidoc [DOCS] Add prereqs to mute unmute alert APIs (#141337) 2022-09-22 13:48:12 -07:00
cases.asciidoc [DOCS] Add final case APIs (#130161) 2022-04-14 15:13:55 -07:00
dashboard-api.asciidoc [data views] data view api docs - index patterns => data views (#119415) 2021-12-01 07:32:05 -06:00
data-views.asciidoc Adds get all REST API to data views (#131683) 2022-06-02 10:00:19 -07:00
features.asciidoc Timelion App removal (#110255) 2021-09-10 14:53:07 +03:00
index-patterns.asciidoc [DOCS] Add deprecated index pattern APIs (#124065) 2022-01-31 15:47:25 -08:00
logstash-configuration-management.asciidoc [DOCS] Updates API requests and examples (#60695) 2020-03-20 16:33:20 -05:00
machine-learning.asciidoc [DOCS] Add machine learning sync API (#112033) 2021-09-21 08:33:48 -07:00
osquery-manager.asciidoc [Osquery] Add docs for Osquery API (#137162) 2022-08-09 18:43:31 +02:00
role-management.asciidoc [DOCS] Updates API requests and examples (#60695) 2020-03-20 16:33:20 -05:00
saved-objects.asciidoc API docs: Add deprecation warning to all deprecated Saved Object APIs (#150267) 2023-02-07 09:28:13 -07:00
session-management.asciidoc Expose session invalidation API. (#92376) 2021-03-24 09:54:08 +01:00
short-urls.asciidoc Short url docs (#113084) 2021-10-12 19:46:58 +02:00
spaces-management.asciidoc Document update objects spaces API (#145109) 2022-11-15 16:55:58 +00:00
upgrade-assistant.asciidoc [DOCS] Adds missing add default field API (#86332) 2020-12-17 13:59:56 -06:00