From c91ebab924f9bbe589374ad0ef4d001221df0c76 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Thu, 1 Aug 2024 09:38:01 -0700 Subject: [PATCH] [OAS][DOCS] Add temporary overlays for Kibana API documents (#189322) (cherry picked from commit 176a2210d769ff004cb0669e002f69099febbec3) --- oas_docs/makefile | 9 ++++----- oas_docs/overlays/kibana.overlays.yaml | 7 +++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/oas_docs/makefile b/oas_docs/makefile index 8569644639651..8787077b1ae7e 100644 --- a/oas_docs/makefile +++ b/oas_docs/makefile @@ -14,18 +14,17 @@ # permission is obtained from Elasticsearch B.V. .PHONY: api-docs -api-docs: ## Generate kibana.yaml - @npx @redocly/cli join "kibana.info.yaml" "../x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml" "../x-pack/plugins/actions/docs/openapi/bundled.yaml" "../src/plugins/data_views/docs/openapi/bundled.yaml" "../x-pack/plugins/ml/common/openapi/ml_apis.yaml" "../packages/core/saved-objects/docs/openapi/bundled.yaml" "../x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml" "bundle.json" -o "output/kibana.yaml" --prefix-components-with-info-prop title +api-docs: ## Generate kibana.serverless.yaml and kibana.yaml + @npx @redocly/cli join "kibana.info.yaml" "../x-pack/plugins/alerting/docs/openapi/bundled.yaml" "../x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml" "../x-pack/plugins/cases/docs/openapi/bundled.yaml" "../x-pack/plugins/actions/docs/openapi/bundled.yaml" "../src/plugins/data_views/docs/openapi/bundled.yaml" "../x-pack/plugins/ml/common/openapi/ml_apis.yaml" "../packages/core/saved-objects/docs/openapi/bundled.yaml" "bundle.json" -o "output/kibana.yaml" --prefix-components-with-info-prop title .PHONY: api-docs-stateful api-docs-stateful: ## Generate only kibana.yaml - @npx @redocly/cli join "kibana.info.yaml" "../x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml" "../x-pack/plugins/actions/docs/openapi/bundled.yaml" "../src/plugins/data_views/docs/openapi/bundled.yaml" "../x-pack/plugins/ml/common/openapi/ml_apis.yaml" "../packages/core/saved-objects/docs/openapi/bundled.yaml" "../x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml" "bundle.json" -o "output/kibana.yaml" --prefix-components-with-info-prop title -# Temporarily omit "../x-pack/plugins/alerting/docs/openapi/bundled.yaml" and "../x-pack/plugins/cases/docs/openapi/bundled.yaml" due to OAS version + @npx @redocly/cli join "kibana.info.yaml" "../x-pack/plugins/alerting/docs/openapi/bundled.yaml" "../x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml" "../x-pack/plugins/cases/docs/openapi/bundled.yaml" "../x-pack/plugins/actions/docs/openapi/bundled.yaml" "../src/plugins/data_views/docs/openapi/bundled.yaml" "../x-pack/plugins/ml/common/openapi/ml_apis.yaml" "../packages/core/saved-objects/docs/openapi/bundled.yaml" "bundle.json" -o "output/kibana.yaml" --prefix-components-with-info-prop title # Temporarily omit "../x-pack/plugins/fleet/common/openapi/bundled.yaml" due to internals tag and tag sorting .PHONY: api-docs-lint api-docs-lint: ## Run spectral API docs linter - @npx @stoplight/spectral-cli lint "output/kibana.yaml" --ruleset ".spectral.yaml" + @npx @stoplight/spectral-cli lint "output/*.yaml" --ruleset ".spectral.yaml" .PHONY: api-docs-lint-stateful api-docs-lint-stateful: ## Run spectral API docs linter on kibana.yaml diff --git a/oas_docs/overlays/kibana.overlays.yaml b/oas_docs/overlays/kibana.overlays.yaml index 7681a7201872a..d1acdf7712bf8 100644 --- a/oas_docs/overlays/kibana.overlays.yaml +++ b/oas_docs/overlays/kibana.overlays.yaml @@ -4,6 +4,7 @@ info: title: Overlays for the Kibana API document version: 0.0.1 actions: + # Clean up server definitions - target: '$.servers.*' description: Remove all servers so we can add our own. remove: true @@ -14,6 +15,11 @@ actions: variables: kibana_url: default: localhost:5601 + # Remove operation-level security definitions + - target: "$.paths['/api/status']['get'].security" + description: Remove system security definitions + remove: true + # Add document-level security definitions - target: '$.components.securitySchemes' description: Add an API key security scheme update: @@ -34,6 +40,7 @@ actions: security: - apiKeyAuth: [] - basicAuth: [] + # Add an introduction to spaces - target: '$' description: Add an extra page about spaces update: