Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Validation result is missing "values.actual" when encountered validator error #430

Open
artem-zakharchenko opened this issue Feb 6, 2020 · 0 comments

Comments

@artem-zakharchenko
Copy link
Contributor

Setup

Validate the following JSON Schema against a matching body:

{
        "type": "object",
        "properties": {
          "a": {
            "type": "string",
            "format": "alphanumeric"
          },
          "c": {
            "type": "integer"
          }
        }
      }

See the next validation result:

{
  "fields": {
    "headers": {
      "kind": null,
      "values": {},
      "errors": []
    },
    "body": {
      "kind": null,
      "values": {},
      "errors": [
        {
          "message": "Validator error: unknown format \"alphanumeric\" is used in schema at path \"#/properties/a\""
        }
      ]
    },
    "statusCode": {
      "kind": null,
      "values": {},
      "errors": []
    }
  },
  "valid": false
}

Current behavior

result.fields.body.values is an empty object. It misses values.actual.

Expected behavior

  • result.fields.body.values.actual is set to the actually validated value.
  • result.fields.body.values.expected is left empty, because it's a validation against JSON Schema, which is not represented in the expected value of the validation result.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant