kinto-admin icon indicating copy to clipboard operation
kinto-admin copied to clipboard

Validate provided collection JSON schema

Open n1k0 opened this issue 9 years ago • 7 comments
trafficstars

I've just spent a few unecessary minutes trying to figure out a weird error I had in the admin because I misspelled properties in my schema, while it was accepted just fine when submitted.

We should validate the entered JSON schema, eg. using https://github.com/mafintosh/is-my-json-valid.

n1k0 avatar May 20 '16 12:05 n1k0

We should validate the entered JSON schema, eg. using https://github.com/mafintosh/is-my-json-valid.

WELL, probably not with this one.

n1k0 avatar May 20 '16 12:05 n1k0

We already have a JSON schema validator actually.

Natim avatar May 20 '16 12:05 Natim

https://github.com/Kinto/kinto/blob/master/kinto/views/collections.py#L24

Natim avatar May 20 '16 12:05 Natim

Well, could it be tweaked a little then? Entering this doesn't make it fail :/

{
  "type": "object",
  "porperties": {
    "content": {
      "type": "string"
    },
    "title": {
      "type": "string"
    }
  }
}

Note porperties.

n1k0 avatar May 20 '16 12:05 n1k0

For example if there's an option to disallow unknown JSON schema property names in the schema itself, that would be nice.

n1k0 avatar May 20 '16 12:05 n1k0

Duplicate of #253 ?

leplatrem avatar Jan 20 '17 10:01 leplatrem

Not really, here the purpose would be to check that the entered json schema actually matches the json schema spec.

n1k0 avatar Jan 20 '17 11:01 n1k0

Closed with PR 3043.

alexcottner avatar Nov 02 '23 18:11 alexcottner