Skip to content

Commit

Permalink
[OAS][DOCS] Add temporary overlays for Kibana API documents (elastic#…
Browse files Browse the repository at this point in the history
…189322)

(cherry picked from commit 176a221)
  • Loading branch information
lcawl committed Aug 1, 2024
1 parent d8b7553 commit c91ebab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 4 additions & 5 deletions oas_docs/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions oas_docs/overlays/kibana.overlays.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -34,6 +40,7 @@ actions:
security:
- apiKeyAuth: []
- basicAuth: []
# Add an introduction to spaces
- target: '$'
description: Add an extra page about spaces
update:
Expand Down

0 comments on commit c91ebab

Please sign in to comment.