Skip to content

ipv4 string format accepts any string #491

Closed
@atnoslen

Description

@atnoslen
Python 2.7.6 (default, Nov 23 2017, 15:49:48)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from jsonschema import validate
>>> schema = {
... "type":"object",
... "properties": {
... "ip": {"type":"string","format":"ipv4"}
... }
... }
>>>
>>> validate({"ip":"10.1.1.1"}, schema)
>>> validate({"ip":"10.1.1.a"}, schema)
>>> validate({"ip":"not.an.ip"}, schema)
>>> validate({"ip":"not"}, schema)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions