Skip to content

Commit cf7a4d3

Browse files
committed
[DOCS][OAS] Add cases to Kibana API bundle (elastic#189020)
(cherry picked from commit d86e139)
1 parent d499ba5 commit cf7a4d3

File tree

124 files changed

+8306
-9018
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+8306
-9018
lines changed

oas_docs/makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515

1616
.PHONY: api-docs
1717
api-docs: ## Generate kibana.yaml
18-
@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
18+
@npx @redocly/cli join "kibana.info.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" "../x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml" "bundle.json" -o "output/kibana.yaml" --prefix-components-with-info-prop title
1919

2020
.PHONY: api-docs-stateful
2121
api-docs-stateful: ## Generate only kibana.yaml
22-
@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
23-
# Temporarily omit "../x-pack/plugins/alerting/docs/openapi/bundled.yaml" and "../x-pack/plugins/cases/docs/openapi/bundled.yaml" due to OAS version
22+
@npx @redocly/cli join "kibana.info.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" "../x-pack/plugins/observability_solution/slo/docs/openapi/slo/bundled.yaml" "bundle.json" -o "output/kibana.yaml" --prefix-components-with-info-prop title
23+
# Temporarily omit "../x-pack/plugins/alerting/docs/openapi/bundled.yaml" due to OAS version
2424
# Temporarily omit "../x-pack/plugins/fleet/common/openapi/bundled.yaml" due to internals tag and tag sorting
2525

2626
.PHONY: api-docs-lint

oas_docs/output/kibana.yaml

Lines changed: 6758 additions & 2172 deletions
Large diffs are not rendered by default.

x-pack/plugins/cases/docs/openapi/README.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,11 @@ A guide about the openApi specification can be found at [https://swagger.io/docs
1313

1414
## Tools
1515

16-
It is possible to validate the docs before bundling them with the following
17-
command in the `x-pack/plugins/cases/docs/openapi/` folder:
18-
19-
```bash
20-
npx swagger-cli validate entrypoint.yaml
21-
```
22-
23-
Then you can generate the `bundled` files by running the following commands:
16+
Generate the `bundled` files by running the following commands:
2417

2518
```bash
2619
npx @redocly/cli bundle entrypoint.yaml --output bundled.yaml --ext yaml
2720
npx @redocly/cli bundle entrypoint.yaml --output bundled.json --ext json
2821
```
2922

30-
After generating the json bundle ensure that it is also valid by running the following command:
31-
32-
```bash
33-
npx @redocly/cli lint bundled.json
34-
```
23+
Then join these files with the rest of the Kibana APIs per `oas_docs/README.md`

x-pack/plugins/cases/docs/openapi/bundled.json

Lines changed: 611 additions & 3357 deletions
Large diffs are not rendered by default.

x-pack/plugins/cases/docs/openapi/bundled.yaml

Lines changed: 550 additions & 2168 deletions
Large diffs are not rendered by default.

x-pack/plugins/cases/docs/openapi/components/parameters/alert_id.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ description: An identifier for the alert.
44
required: true
55
schema:
66
type: string
7-
examples:
8-
- 09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540
7+
example: 09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540

x-pack/plugins/cases/docs/openapi/components/parameters/case_id.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ description: The identifier for the case. To retrieve case IDs, use the find cas
44
required: true
55
schema:
66
type: string
7-
examples:
8-
- 9c235210-6834-11ea-a78c-6ffb38a34414
7+
example: 9c235210-6834-11ea-a78c-6ffb38a34414

x-pack/plugins/cases/docs/openapi/components/parameters/category.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ description: Filters the returned cases by category.
44
schema:
55
oneOf:
66
- type: string
7+
example: my-category
78
- type: array
89
items:
910
type: string
10-
maxItems: 100
11-
examples:
12-
- [ my-category ]
11+
maxItems: 100

x-pack/plugins/cases/docs/openapi/components/parameters/comment_id.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ description: >
66
required: true
77
schema:
88
type: string
9-
examples:
10-
- '71ec1870-725b-11ea-a0b2-c51ea50a58e2'
9+
example: '71ec1870-725b-11ea-a0b2-c51ea50a58e2'

x-pack/plugins/cases/docs/openapi/components/parameters/configuration_id.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ description: An identifier for the configuration.
44
required: true
55
schema:
66
type: string
7-
examples:
8-
- 3297a0f0-b5ec-11ec-b141-0fdb20a7f9a9
7+
example: 3297a0f0-b5ec-11ec-b141-0fdb20a7f9a9

0 commit comments

Comments
 (0)