Why is this json schema invalid? using "any" type

jononomo picture jononomo · May 30, 2013 · Viewed 11.1k times · Source
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "my json api",
    "description": "my json api",
    "type": "object",
    "properties": {
        "my_api_response": {
           "type": "object",
            "properties": {
                "MailboxInfo": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "ADSyncLinkEnabled": {
                                "type": "any"
                            }
                        }
                    }
                }
            }
        }
    },
    "required": ["response"]
}

I am using python jsonschema 2.0.0 and it gives me the following error:

{u'type': u'object', u'properties': {u'ADSyncLinkEnabled': {u'type': u'any'}}} is not valid under any of the given schemas

Answer

fge picture fge · May 30, 2013

This is because any is no longer a valid value for the type keyword.

If you want a schema which matches everything, just use the empty schema: {}.