codecombat / treema

jQuery plugin that generates HTML interfaces to edit JSON data defined by json-schema.
http://codecombat.github.io/treema/
MIT License
152 stars 36 forks source link

patternProperty content type isn't checked correctly #26

Closed rubenvereecken closed 10 years ago

rubenvereecken commented 10 years ago

I need a patternProperty for my Mongo query, which can hold just about any keys. Currently I'm testing with

patternProperties:
    '^[-a-zA-Z0-9_]*$': { type: 'string' }

Yet treema allows me to pick any type (with its little menu thingie). However, if I hardcode my test property called 'levelID', it gets recognized correctly, like so.

properties
    'levelID': { type: 'string' }

I don't mind checking this myself at all but I have to be off for a bit and I was hoping anyone could point me in the right direction of where a property's contents are verified against.

Recap: patternProperties ignore the type I define them with even though they get matched. Moreover, I put some faulty stuff in there which Treema threw errors at, so it does get checked.

sderickson commented 10 years ago

Here's the code to work on to support patternProperties: