From 89e3f78f40155cdb74c56672e8f42976003ee977 Mon Sep 17 00:00:00 2001 From: Joel Rosario Date: Mon, 7 Oct 2024 11:45:56 +0200 Subject: [PATCH] Updated the documentation on validating external examples --- documentation/external_examples.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/documentation/external_examples.md b/documentation/external_examples.md index 3f4e9745..c96bedb9 100644 --- a/documentation/external_examples.md +++ b/documentation/external_examples.md @@ -13,14 +13,7 @@ External Examples ## Validate External Examples -All examples in a specification can be easily validated using the command `java -jar specmatic.jar examples validate --contract-file ` - -This command validates examples that can be run (either as test or stub), including: - -1. external examples in the `_examples` directory of the specification -2. inline request and response examples having matching names -3. inline requests where the response has no body -4. inline responses where the request has no body +All examples in a specification can be easily validated using the command `java -jar specmatic.jar examples validate --contract-file `. It will exit with return code `1` if any example is not in sync. @@ -115,3 +108,5 @@ Let's try this out. - Check the exit code. On MacOS or *nix, run `echo $?`. On Windows, run `echo %errorlevel%`. You'll see the exit code of `1`. Now add a name to the request in the above example, and try running the command again. This time the validation will succeed. + +You will find other helpful parameters for this command by running `java -jar specmatic.jar examples validate --help`.