From 86fe2ffc8b9c38d8904db51627fa0b3357f15345 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Tue, 7 Feb 2023 10:23:31 +0100 Subject: [PATCH] Improved error messages for missing "formatVersion" (#481) * Rename Actions * Improve error message for missing "formatVersion" * Fix typo in action --- .github/workflows/py-validation.yml | 4 ++-- json-validator.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/py-validation.yml b/.github/workflows/py-validation.yml index 157efca37..d0d8a1cfc 100644 --- a/.github/workflows/py-validation.yml +++ b/.github/workflows/py-validation.yml @@ -1,4 +1,4 @@ -name: Validate JSON data +name: Validate JSON examples on: pull_request: @@ -9,7 +9,7 @@ permissions: jobs: build: # Name the Job - name: Validate data against JSON schema + name: Validate JSON examples against their schema runs-on: ubuntu-latest diff --git a/json-validator.py b/json-validator.py index c6398a32b..2f6a999af 100644 --- a/json-validator.py +++ b/json-validator.py @@ -29,7 +29,7 @@ def match_schema_instance( ): try: version = json_data["formatVersion"] except KeyError: - msg_errors.append(f"::error file={instance},line={1},col={1}::JSON data does not provide a formatVersion") + msg_errors.append(f"::error file={instance},line={1},col={1}::JSON example does not specify the field \"formatVersion\"") continue except TypeError: # in case decoding failed