Question: I need a jsonschema to validate JSON where all keys are required to be strings. All keys are arbitrary.

For example this should be valid

```
{

    "123": "GET",
    "key2": "/mellons/and/strawberries",
    "arbitrary_key": {
        "SomeKey": "some data",
    },
}

```

while this should not 

```
{

    123: "GET",
    "key2": "/mellons/and/strawberries",
    "arbitrary_key": {
        "SomeKey": "some data",
    },
}

```

Validating with `patternProperties` does not work, as this regex `"^.*$"` seems to match numbers as well as strings.

Answer: 
According to [JSON](http://json.org/) the object keys are always strings (just take a look at the first graph). Some parsers may allow the use of numbers too as a string though.

Since json schema is supposed to validate the structure of valid json documents, it won't recognize lexically malformed json strings. This is out of scope for json schema. You also shouldn't mix up JSON and javascript objects.

So if you are really sure about that you want to catch such non-well-formed JSONs then probably the best you can do is picking a parser that has a strict mode.
```
a={

    123: "GET",
    "key2": "/mellons/and/strawberries",
    "arbitrary_key": {
        "SomeKey": "some data",
    },
};
Object.keys(a) // this gives array of keys can assign check here

```