-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add If-Then-Else schema validation. #581
Add If-Then-Else schema validation. #581
Conversation
Isn't this a Json Schema 7 feature? We're still on 5. |
@shmax We're still on 4, actually. Version 5 was never actually a thing. But I don't want to turn this down; we're going to need support for more recent versions anyway, and if somebody has the time to help out, then I'm in favour of it provided said help is spec-compliant. @niconoe- Thank you for this contribution. However, if you want us to merge it, it needs to be fully spec-compliant, and it needs to pass the official test suite, same as we currently do for v3 and v4 - individual custom tests for this specific feature aren't sufficient, and there are a lot more eyes on the official tests to ensure that they are comprehensive and spec-compliant. We'll also need support for schema validation against the v7 meta-schema (or at least the parts of it that pertain to this feature). |
Right. I don't know where I got 5 from. But neither 4 nor 5 are 7, and I figured that gearing up for 7 is going to be a bit more complex than sneaking piecemeal features into the same space as 4. |
@shmax Less complicated than you might think, although I agree that your statement definitely applies to full v7 support. But this particular feature is one that can be implemented standalone, and also happens to be useful standalone. We don't do strict versioning (e.g. you can combine v3 and v4 syntax in a schema); this would behave the same. |
@shmax @erayd Thank you for your feedbacks. Actually, I propose this PR because I needed JSON schema validation on a project of mine and I tried some tools, but this one was the best even if it's not fully schema-draft-07 complient. I just add the if-then-else management for my business needs and I wanted to participate on providing this PR. I could try to start validate the "if-then-else" part of the meta-schema-07, but I don't know yet if there's something started on v7 validation. I saw this on v3 and v4 only. If nothing has been done yet, it could pollute this PR as it might be a heavy stuff, don't you think? I'd rather like to provide a v7 meta-schema validation first with only "if-then-else" management on a separate PR. What's your opinion on this? Beside this, I have 2 questions:
Thanks a lot. EDIT: @erayd After working on #582, I better understand now the test suite you mentionned. It could be painful to validate only some parts of the Draft 07 according to the current PHPUnit TestCase structure you have built, but I will give it a try in a future PR in which I'll include the Draft 07 validation. |
Closing in favor of #715 |
Hi,
This is a proposal to be able to understand schema validation with the "if-then-else" schema properties.
Please provide more test cases in the unit test if you want to check more things, but I think all cases are checked here.
Have a nice day.
Regards,