Package Proposal - JSON Schema Validator

118 views
Skip to first unread message

Matthew Allan

unread,
Mar 4, 2016, 8:24:27 AM3/4/16
to thephpleague
Hi everyone,

I wrote a package to validate http://json-schema.org/ schemas.  If you aren't familiar with JSON Schema, a good overview is this article.


The package adheres to all of the league quality guidelines and I wrote full documentation.  I've been waiting to tag a stable release until I figure out where the package is going to go.  If the league accepts the package I will come up with a better name. :)

There is one other package that does the same thing, https://github.com/justinrainbow/json-schema.  These are the big improvements of this package:

- Passes the entire test suite for Draft 4 of the schema.  The existing package skips a lot of the tests.
- Fully supports circular references.  The existing package prevents recursion when it should be allowed.
- Allows extending the validator with custom formats.
- Provides detailed error messages a JSON pointer and unique error code.  The existing package just returns the property name and a message.

I wrote this package after spending six months working with the existing package at work and constantly being frustrated.  I would have tried to fix the existing package but the changes were significant enough to merit a rewrite, and the existing package's code was really hard to read IMO.  The reference resolving approach is completely different in order to accomplish the improvements mentioned earlier.

Thanks!

- Matt

Ben Ramsey

unread,
Mar 5, 2016, 10:52:10 AM3/5/16
to Matthew Allan, thephpleague
I support accepting this as a league package.

-Ben

--
You received this message because you are subscribed to the Google Groups "thephpleague" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thephpleague...@googlegroups.com.
To post to this group, send email to thephp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thephpleague/443f0b5e-b6c8-487d-bb30-3cc2a7ecc9dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jonathan Reinink

unread,
Mar 5, 2016, 11:07:35 AM3/5/16
to Ben Ramsey, Matthew Allan, thephpleague
Yes, same, looks awesome!

Woody Gilk

unread,
Mar 5, 2016, 11:09:32 AM3/5/16
to thephpleague
Excellent introduction to the package and good job doing the due diligence regarding comparing to existing packages! 

I support accepting this package, but would like to see some additional polishing done on it before version 1.0 final. I would suggest accepting it as a version 0.x to allow some method renames and improvements to the code style.

Matthew Allan

unread,
Mar 7, 2016, 11:41:58 AM3/7/16
to thephpleague
Hi everyone,

Thanks for the feedback.  Waiting to tag a stable release is fine with me.  I have some things I would like to clean up but the public interface should stay pretty stable.

Definitely let me know if there are specific improvements you would like to see to the code.  You can reach me here, and I'm also in the apisyouwonthate slack as @matthew-james.

Thanks!

- Matt

Matthew Allan

unread,
Apr 22, 2016, 2:21:41 PM4/22/16
to thephpleague
Hi League,

I've been busy but I got a lot of refactoring done.  The package moved to https://github.com/yuloh/json-guard and I tagged version 0.1.0. I am 95% happy with it but I'm not ready to tag a stable release yet.

Can we go ahead and move this to the league as a work in progress 0.x package?  What do I need to do?

Thanks!

Matt

Barry vd. Heuvel

unread,
Apr 30, 2016, 3:06:48 PM4/30/16
to thephpleague
Hey all,

It seems that a v2 of justinrainbow/json-schema is released, with support for draf4 and changed the way it handles references. I don't know if that fixes the biggest issues you had with the other library?


Barry

Op vrijdag 22 april 2016 20:21:41 UTC+2 schreef Matthew Allan:

Frank de Jonge

unread,
May 1, 2016, 5:43:07 AM5/1/16
to thephpleague
I like what I'm seeing here. I'm calling an acceptance vote. I'll get back to you when we have the result.


Op vrijdag 22 april 2016 20:21:41 UTC+2 schreef Matthew Allan:
Hi League,

Frank de Jonge

unread,
May 3, 2016, 9:41:09 AM5/3/16
to thephpleague
Hi Matt,

I'm pleased to be able to tell your package has been accepted. I'll be helping with the transition. Can you email me at info [at] frankdejonge.nl so we can get the transition started?

Op zondag 1 mei 2016 11:43:07 UTC+2 schreef Frank de Jonge:
Reply all
Reply to author
Forward
0 new messages