diff --git a/.spectral.yaml b/.spectral.yaml index b328e320e2..82886069f5 100644 --- a/.spectral.yaml +++ b/.spectral.yaml @@ -69,7 +69,7 @@ rules: given: $.paths[*].[get,put,post,delete,options,head,patch,trace] then: field: summary - function: defined + function: defined operation-summary-length: description: Operation summary should be between 5 and 45 characters given: "$.paths[*].[get,put,post,delete,options,head,patch,trace]" diff --git a/Makefile b/Makefile index 44ce12bce1..03b736e89f 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,7 @@ setup: ## Install dependencies for contrib target @make clean-dep @npm install --prefix compiler @npm install --prefix typescript-generator + @npm install @stoplight/spectral-cli clean-dep: ## Clean npm dependencies @rm -rf compiler/node_modules @@ -58,6 +59,9 @@ dump-routes: ## Create a new schema with all generics expanded contrib: | generate license-check spec-format-fix transform-to-openapi ## Pre contribution target +lint-docs: ## Lint the OpenAPI documents + @npx @stoplight/spectral-cli lint output/openapi/elasticsearch-serverless-openapi.json + help: ## Display help @awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) #------------- --------------