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

AnyOf together with pattern matching not working #6

Closed
icepol opened this issue Apr 25, 2018 · 2 comments
Closed

AnyOf together with pattern matching not working #6

icepol opened this issue Apr 25, 2018 · 2 comments

Comments

@icepol
Copy link

icepol commented Apr 25, 2018

Hi, pls. for this example:

import fastjsonschema

schema = {
    'type': 'object',
    'properties': {
        'hash': {
            'anyOf': [
                {
                    'type': 'string',
                    'pattern': '^AAA'
                },
                {
                    'type': 'string',
                    'pattern': '^BBB'
                }
            ]
        }
    }
}

validator = fastjsonschema.compile(schema)

data = {
    'hash': 'AAAXXX',
}

validator(data)

Expected: data are valid against the schema.
Actual: fastjsonschema.exceptions.JsonSchemaException: data.hash must be valid by one of anyOf definition
Python version: 3.6
fastjsonschema version: 1.2

Looks like anyOf together with pattern matching is not working as expected.

horejsek pushed a commit that referenced this issue Apr 25, 2018
horejsek added a commit that referenced this issue Apr 25, 2018
@horejsek
Copy link
Owner

Thanks for reporting! Have you found any other bug in new version? :-)

@icepol
Copy link
Author

icepol commented Apr 25, 2018

thanks for the fix :)
nope, all other is working just fine.

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

2 participants