diff --git a/.gitignore b/.gitignore index 68826241d8..1861b77072 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +output/openapi/elasticsearch-openapi.examples.json +output/openapi/elasticsearch-serverless-openapi-docs.json +output/openapi/elasticsearch-openapi-docs.json \ No newline at end of file diff --git a/Makefile b/Makefile index a081ef77dc..ba01681ee8 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/README.md b/README.md index b440301369..8525767d85 100644 --- a/README.md +++ b/README.md @@ -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