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

oneOf or string format validators issue #50

Open
avaly opened this issue Feb 17, 2015 · 0 comments
Open

oneOf or string format validators issue #50

avaly opened this issue Feb 17, 2015 · 0 comments

Comments

@avaly
Copy link

avaly commented Feb 17, 2015

There seems to be an issue in either the oneOf logic or the format validators. The following test fixture returns the errors below when unit tests as ran:

[
    {
        "description": "oneOf bug",
        "schema": {
            "oneOf": [
                {
                    "type": "string",
                    "format": "email"
                },
                {
                    "type": "string",
                    "format": "uri"
                }
            ]
        },
        "tests": [
            {
                "description": "first oneOf valid",
                "data": "[email protected]",
                "valid": true
            },
            {
                "description": "second oneOf valid",
                "data": "http://google.com",
                "valid": true
            },
            {
                "description": "neither oneOf valid format",
                "data": "asd",
                "valid": false
            },
            {
                "description": "neither oneOf valid type",
                "data": 1,
                "valid": false
            }
        ]
    }
]
  _bug.json
    oneOf bug
      1) first oneOf valid


  0 passing (7ms)
  1 failing

  1) _bug.json oneOf bug first oneOf valid:
     AssertionError: expected { validation: { oneOf: true } } to equal null

Tested with version 1.0.2.

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