Skip to content

Conversation

@Psykar
Copy link
Contributor

@Psykar Psykar commented Mar 6, 2017

No description provided.

@Psykar
Copy link
Contributor Author

Psykar commented Mar 6, 2017

It's worth nothing your existing schema there was broken according to the spec it seems.
I'm sure this one can be expanded later if required.

@gajus
Copy link
Owner

gajus commented Mar 6, 2017

Correct me if I am wrong, but it should be:

"patternProperties": {
    "\\..*": {"type": "string"}
},
"patternRequired": ["\\..*"]

@Psykar
Copy link
Contributor Author

Psykar commented Mar 6, 2017

I won't claim to know json schema layouts. But the above threw an error correctly when I left a period off filetypes in my config saying the schema didn't pass.

I can try adding a unit test if you'd prefer? I just threw this together quickly.

@Psykar
Copy link
Contributor Author

Psykar commented Mar 6, 2017

This page : http://json-schema.org/example2.html
has the following

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "/": {}
    },
    "patternProperties": {
        "^(/[^/]+)+$": {}
    },
    "additionalProperties": false,
    "required": [ "/" ]
}

And their spiel matches what I'd expect.

@gajus gajus merged commit 629e009 into gajus:master Mar 6, 2017
@gajus
Copy link
Owner

gajus commented Mar 6, 2017

Thank you

@Psykar Psykar deleted the bugfix/filetype-schema branch March 6, 2017 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants