Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant