The Core team added support for OAS in the Kibana routes. To provide users with an up-to-date OAS for the documented public Cases API we need to register the OAS schema on each public route. Cases routes are versioned but they use io-ts for schema validation. The Kibana router does not support io-ts for OAS generation. Based on https://github.com/elastic/kibana/pull/186190, they added support for zod. Based on an analysis we did in the past, we concluded that zod would be a good fit for Cases schema. To be able to support OAS in the Cases public APIs we need to convert our schemas to zod and then register the schema on our routes.
Requirements:
The schema of the request and response should be in zod.
Each route should register the route's validate config for route validation.
Routes do not have to use the addVersion property.
All attributes of all schemas should add the description meta property.
Do not document deprecated properties or routes.
API routes
[ ] GET /api/cases/alerts/{alert_id}
[ ] GET /api/cases/reporters
[ ] GET /api/cases/tags
[ ] DELETE /api/cases
[ ] GET /api/cases/_find
[ ] GET /api/cases/{case_id}
[ ] PATCH /api/cases
[ ] POST /api/cases
[ ] POST /api/cases/{case_id}/connector/{connector_id}/_push
The Core team added support for OAS in the Kibana routes. To provide users with an up-to-date OAS for the documented public Cases API we need to register the OAS schema on each public route. Cases routes are versioned but they use
io-ts
for schema validation. The Kibana router does not supportio-ts
for OAS generation. Based on https://github.com/elastic/kibana/pull/186190, they added support forzod
. Based on an analysis we did in the past, we concluded thatzod
would be a good fit for Cases schema. To be able to support OAS in the Cases public APIs we need to convert our schemas tozod
and then register the schema on our routes.Requirements:
zod
.validate
config for route validation.API routes
GET /api/cases/alerts/{alert_id}
GET /api/cases/reporters
GET /api/cases/tags
DELETE /api/cases
GET /api/cases/_find
GET /api/cases/{case_id}
PATCH /api/cases
POST /api/cases
POST /api/cases/{case_id}/connector/{connector_id}/_push
DELETE /api/cases/{case_id}/comments
DELETE /api/cases/{case_id}/comments/{comment_id}
GET /api/cases/{case_id}/comments/_find
GET /api/cases/{case_id}/alerts
GET /api/cases/{case_id}/comments/{comment_id}
PATCH /api/cases/{case_id}/comments
POST /api/cases/{case_id}/comments
GET /api/cases/configure
GET /api/cases/configure/connectors/_find
PATCH /api/cases/configure/{configuration_id}
POST /api/cases/configure
GET /api/cases/{case_id}/user_actions/_find