[OAS][DOCS] Temporarily omit security APIs from docs (#190467)

This commit is contained in:
Lisa Cawley 2024-08-14 09:52:18 -07:00 committed by GitHub
parent 96d3325524
commit 1144c0cea7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 138 additions and 35090 deletions

View file

@ -1,8 +1,9 @@
The `bundle.json` and `bundle.serverless.json` files are generated automatically.
See `node scripts/capture_oas_snapshot --help` for more info.
The `output/kibana.serverless.yaml` file is a temporary OpenAPI document created by joining some manually-maintained files.
To create it and lint it, run `make api-docs` or `make api-docs-serverless` and `make api-docs-lint` or `make api-docs-lint-serverless`.
The `output/kibana.serverless.yaml` and `output/kibana.yaml` files join some manually-maintained files with the automatically generated files.
To add integrate more files into this bundle, edit the appropriate `oas_docs/scripts/merge*.js` files.
To generate the bundled files, run `make api-docs` (or `make api-docs-serverless` and `make api-docs-stateful`).
To lint them, run `make api-docs-lint` (or `make api-docs-lint-serverless` and `make api-lint-stateful`).
The `output/kibana.yaml` file is a temporary OpenAPI document created by joining some manually-maintained files.
To create it and lint it, run `make api-docs` or `make api-docs-stateful` and `make api-docs-lint` or `make api-docs-lint-stateful`.
To apply some overlays that perform some post-processing and append some content, run `make api-docs-overlay`.

View file

@ -18,19 +18,18 @@ api-docs: ## Generate Serverless and ESS Kibana OpenAPI bundles with kbn-openapi
@node scripts/merge_serverless_oas.js
@node scripts/merge_ess_oas.js
.PHONY: api-docs-redocly
api-docs-redocly: ## Generate kibana.serverless.yaml and kibana.yaml with Redocly CLI
@npx @redocly/cli join "kibana.info.serverless.yaml" "../x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml" "../x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml" "../src/plugins/data_views/docs/openapi/bundled.yaml" "../x-pack/plugins/ml/common/openapi/ml_apis_serverless.yaml" "../packages/core/saved-objects/docs/openapi/bundled_serverless.yaml" "../x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml" "bundle.serverless.json" -o "output/kibana.serverless.yaml" --prefix-components-with-info-prop title
@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-staging
api-docs-staging: ## Generate Serverless and ESS Kibana OpenAPI bundles with kbn-openapi-bundler
@node scripts/merge_serverless_oas_staging.js
@node scripts/merge_ess_oas_staging.js
.PHONY: api-docs-stateful
api-docs-stateful: ## Generate only 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
# Temporarily omit "../x-pack/plugins/fleet/common/openapi/bundled.yaml" due to internals tag and tag sorting
@node scripts/merge_ess_oas.js
.PHONY: api-docs-serverless
api-docs-serverless: ## Generate only kibana.serverless.yaml
@npx @redocly/cli join "kibana.info.serverless.yaml" "../x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml" "../x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml" "../src/plugins/data_views/docs/openapi/bundled.yaml" "../x-pack/plugins/ml/common/openapi/ml_apis_serverless.yaml" "../packages/core/saved-objects/docs/openapi/bundled_serverless.yaml" "../x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml" "bundle.serverless.json" -o "output/kibana.serverless.yaml" --prefix-components-with-info-prop title
@node scripts/merge_serverless_oas.js
.PHONY: api-docs-lint
api-docs-lint: ## Run spectral API docs linter

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -105,10 +105,10 @@ actions:
description: Change displayName
update:
x-displayName: "Saved objects"
# - target: '$.tags[?(@.name=="slo")]'
# description: Change displayName
# update:
# x-displayName: "Service level objectives"
- target: '$.tags[?(@.name=="slo")]'
description: Change displayName
update:
x-displayName: "Service level objectives"
- target: '$.tags[?(@.name=="system")]'
description: Change displayName
update:

View file

@ -24,12 +24,6 @@ const { REPO_ROOT } = require('@kbn/repo-info');
`${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`,
// Security solution
`${REPO_ROOT}/x-pack/plugins/security_solution/docs/openapi/ess/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-lists-common/docs/openapi/ess/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/*.schema.yaml`,
`${REPO_ROOT}/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/*.schema.yaml`,
`${REPO_ROOT}/x-pack/plugins/osquery/docs/openapi/ess/*.schema.yaml`,
],
outputFilePath: `${REPO_ROOT}/oas_docs/output/kibana.yaml`,
options: {

View file

@ -0,0 +1,39 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
require('../../src/setup_node_env');
const { merge } = require('@kbn/openapi-bundler');
const { REPO_ROOT } = require('@kbn/repo-info');
(async () => {
await merge({
sourceGlobs: [
`${REPO_ROOT}/oas_docs/bundle.json`,
`${REPO_ROOT}/x-pack/plugins/actions/docs/openapi/bundled.yaml`,
`${REPO_ROOT}/src/plugins/data_views/docs/openapi/bundled.yaml`,
`${REPO_ROOT}/x-pack/plugins/ml/common/openapi/ml_apis.yaml`,
`${REPO_ROOT}/packages/core/saved-objects/docs/openapi/bundled.yaml`,
// Observability Solution
`${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml`,
`${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`,
// Security solution
`${REPO_ROOT}/x-pack/plugins/security_solution/docs/openapi/ess/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-lists-common/docs/openapi/ess/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/*.schema.yaml`,
`${REPO_ROOT}/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/*.schema.yaml`,
`${REPO_ROOT}/x-pack/plugins/osquery/docs/openapi/ess/*.schema.yaml`,
],
outputFilePath: `${REPO_ROOT}/oas_docs/output/kibana.staging.yaml`,
options: {
prototypeDocument: `${REPO_ROOT}/oas_docs/kibana.info.yaml`,
},
});
})();

View file

@ -24,16 +24,10 @@ const { REPO_ROOT } = require('@kbn/repo-info');
`${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`,
// Security solution
`${REPO_ROOT}/x-pack/plugins/security_solution/docs/openapi/serverless/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/*.schema.yaml`,
`${REPO_ROOT}/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/*.schema.yaml`,
`${REPO_ROOT}/x-pack/plugins/osquery/docs/openapi/serverless/*.schema.yaml`,
],
outputFilePath: `${REPO_ROOT}/oas_docs/output/kibana.serverless.yaml`,
options: {
prototypeDocument: `${REPO_ROOT}/oas_docs/kibana.info.yaml`,
prototypeDocument: `${REPO_ROOT}/oas_docs/kibana.info.serverless.yaml`,
},
});
})();

View file

@ -0,0 +1,39 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
require('../../src/setup_node_env');
const { merge } = require('@kbn/openapi-bundler');
const { REPO_ROOT } = require('@kbn/repo-info');
(async () => {
await merge({
sourceGlobs: [
`${REPO_ROOT}/oas_docs/bundle.serverless.json`,
`${REPO_ROOT}/x-pack/plugins/actions/docs/openapi/bundled_serverless.yaml`,
`${REPO_ROOT}/src/plugins/data_views/docs/openapi/bundled.yaml`,
`${REPO_ROOT}/x-pack/plugins/ml/common/openapi/ml_apis_serverless.yaml`,
`${REPO_ROOT}/packages/core/saved-objects/docs/openapi/bundled_serverless.yaml`,
// Observability Solution
`${REPO_ROOT}/x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml`,
`${REPO_ROOT}/x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml`,
// Security solution
`${REPO_ROOT}/x-pack/plugins/security_solution/docs/openapi/serverless/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/*.schema.yaml`,
`${REPO_ROOT}/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/*.schema.yaml`,
`${REPO_ROOT}/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/*.schema.yaml`,
`${REPO_ROOT}/x-pack/plugins/osquery/docs/openapi/serverless/*.schema.yaml`,
],
outputFilePath: `${REPO_ROOT}/oas_docs/output/kibana.serverless.staging.yaml`,
options: {
prototypeDocument: `${REPO_ROOT}/oas_docs/kibana.info.serverless.yaml`,
},
});
})();