@@ -32,7 +32,7 @@ nvm install 14
32
32
$ git clone https://github.com/elastic/elasticsearch-specification.git
33
33
34
34
# install the dependencies
35
- $ make setup-env
35
+ $ make setup
36
36
37
37
# generate the JSON representation
38
38
$ make spec-generate
@@ -46,11 +46,8 @@ $ cat output/schema/schema.json
46
46
```
47
47
Usage:
48
48
make <target>
49
- validation-all Run Validation on all Endpoints
50
- validation-all-fresh Run Validation on all Endpoints with a fresh setup
51
- validation-api Validate Endpoint with param: api=<api-name>
52
- validation-api-request Validate request of Endpoint with param: api=<api-name>
53
- validation-api-response Validate response of Endpoint with param: api=<api-name>
49
+ validate Validate a given endpoint request or response
50
+ validate-no-cache Validate a given endpoint request or response without local cache
54
51
license-check Add the license headers to the files
55
52
license-add Add the license headers to the files
56
53
spec-format-check Check specification formatting rules
60
57
spec-imports-fix Fix the TypeScript imports
61
58
spec-dangling-types Generate the dangling types rreport
62
59
setup-env Install dependencies for contrib target
60
+ clean-dep Clean npm dependencies
63
61
contrib Pre contribution target
64
62
help Display help
65
63
```
@@ -189,40 +187,18 @@ git clone https://github.com/elastic/elasticsearch-specification.git
189
187
git clone https://github.com/elastic/clients-flight-recorder.git
190
188
191
189
cd elasticsearch-specification
192
- STACK_VERSION=... ./run-validations.sh
190
+ # this will validate the xpack.info request type agains the 8.1.0 stack version
191
+ make validate api=xpack.info type=request stack-version=8.1.0-SNAPSHOT
193
192
```
194
193
195
194
The last command above will install all the dependencies and run, download
196
195
the test recordings and finally validate the specification.
197
- If you need to download the recordings again, run ` STACK_VERSION=... PULL_LATEST=true ./run-validations.sh ` .
198
-
199
- You can validate a specific API with the ` --api ` option, same goes for ` --request ` and ` --response ` .
200
- For example, the following command validates the index request api:
201
-
202
- ``` js
203
- STACK_VERSION = ... ./ run- validations .sh -- api index -- request
204
- ```
205
- The following command validates the index response api:
206
-
207
- ``` js
208
- STACK_VERSION = ... ./ run- validations .sh -- api index -- response
209
- ```
210
- The following command validates the index request and response api:
211
-
212
- ``` js
213
- STACK_VERSION = ... ./ run- validations .sh -- api index -- request -- response
214
- ```
196
+ If you need to download the recordings again, run ` make validate-no-cache api=xpack.info type=request stack-version=8.1.0-SNAPSHOT ` .
215
197
216
198
Once you see the errors, you can fix the original definition in ` /specification `
217
199
and then run the command again until the types validator does not trigger any new error.
218
200
Finally open a pull request with your changes.
219
201
220
- Namespaced APIs can be validated in the same way, for example:
221
-
222
- ``` js
223
- STACK_VERSION = ... ./ run- validations .sh -- api cat .health -- request
224
- ```
225
-
226
202
## Documentation
227
203
228
204
- [ How to add a new API] ( ./docs/add-new-api.md )
@@ -269,12 +245,7 @@ You should copy from there the updated endpoint defintion and change it here.
269
245
270
246
### The validation in broken on GitHub but works on my machine!
271
247
272
- Very likely the recordings on your machine are stale, you can download
273
- the latest version with:
274
-
275
- ``` sh
276
- STACK_VERSION=... PULL_LATEST=true ./run-validations.sh
277
- ```
248
+ Very likely the recordings on your machine are stale, rerun the validation with the ` validate-no-cache ` make target.
278
249
279
250
You should pull the latest change from the ` client-flight-recorder ` as well.
280
251
@@ -309,7 +280,7 @@ If you are using MacOS, run the following command to fix the issue:
309
280
brew install coreutils
310
281
```
311
282
312
- ### The ` recordings-dev ` folder contains a zip file and not the ` tmp-* ` folders
283
+ ### The ` recordings ` folder contains a zip file and not the ` tmp-* ` folders
313
284
314
285
Very likely your system does not have the ` zip ` command installed.
315
286
``` sh
0 commit comments