Skip to content

[Backport 9.0] Add elasticsearch-serverless-openapi-docs.json #4547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,6 @@ compiler/test/**/output/
output/openapi/elasticsearch-serverless-openapi.tmp*.json
output/openapi/elasticsearch-serverless-openapi.examples.json
output/openapi/elasticsearch-openapi.tmp*.json
output/openapi/elasticsearch-openapi.examples.json
output/openapi/elasticsearch-openapi.examples.json
output/openapi/elasticsearch-serverless-openapi-docs.json
output/openapi/elasticsearch-openapi-docs.json
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,9 @@ dump-routes: ## Create a new schema with all generics expanded
@npm run dump-routes --prefix compiler

overlay-docs: ## Apply overlays to OpenAPI documents
@npx bump overlay "output/openapi/elasticsearch-serverless-openapi.json" "docs/overlays/elasticsearch-serverless-openapi-overlays.yaml" > "output/openapi/elasticsearch-serverless-openapi.tmp1.json"
@npx bump overlay "output/openapi/elasticsearch-serverless-openapi.tmp1.json" "docs/overlays/elasticsearch-shared-overlays.yaml" > "output/openapi/elasticsearch-serverless-openapi.tmp2.json"
@npx @redocly/cli bundle output/openapi/elasticsearch-serverless-openapi.tmp2.json --ext json -o output/openapi/elasticsearch-serverless-openapi.examples.json
@npx bump overlay "output/openapi/elasticsearch-openapi.json" "docs/overlays/elasticsearch-openapi-overlays.yaml" > "output/openapi/elasticsearch-openapi.tmp1.json"
@npx bump overlay "output/openapi/elasticsearch-openapi.tmp1.json" "docs/overlays/elasticsearch-shared-overlays.yaml" > "output/openapi/elasticsearch-openapi.tmp2.json"
@npx @redocly/cli bundle output/openapi/elasticsearch-openapi.tmp2.json --ext json -o output/openapi/elasticsearch-openapi.examples.json
rm output/openapi/elasticsearch-serverless-openapi.tmp*.json
rm output/openapi/elasticsearch-openapi.tmp*.json

lint-docs: ## Lint the OpenAPI documents after overlays
Expand All @@ -77,9 +73,6 @@ lint-docs: ## Lint the OpenAPI documents after overlays
lint-docs-stateful: ## Lint only the elasticsearch-openapi.examples.json file
@npx @redocly/cli lint "output/openapi/elasticsearch-openapi.examples.json" --config "docs/linters/redocly.yaml" --format stylish --max-problems 500

lint-docs-serverless: ## Lint only the serverless OpenAPI document after overlays
@npx @redocly/cli lint "output/openapi/elasticsearch-serverless-openapi.examples.json" --config "docs/linters/redocly.yaml" --format stylish --max-problems 500

contrib: | generate license-check spec-format-fix transform-to-openapi filter-for-serverless lint-docs ## Pre contribution target

help: ## Display help
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ Follow the steps to generate the JSON representation, then:
```
# Generate the OpenAPI representation
$ make transform-to-openapi
```

To generate the JSON representation that is used for documentation purposes, the commands are different:

```
# Generate the OpenAPI files
$ make transform-to-openapi-for-docs

# Apply fixes
$ make overlay-docs
Expand Down