jdesrosiers / json-object-php

JSON Schema driven data-type
MIT License
8 stars 3 forks source link

Any further work? #1

Open weitzman opened 6 years ago

weitzman commented 6 years ago

Hi there. This looks like just the project I need for some integration of Patternlab with Drupal. I see that the last commit was in 2014. Any chance that development is happening elsewhere? Or maybe another similar project has come up in the meanwhile? I'd love your guidance as use PHP to build many JSON files that conform to a JSON schema.

jdesrosiers commented 6 years ago

Yeah, this project has been stale for a long time. As I recall, the main reason I didn't pursue it at the time was because PHP wasn't capable of doing enough of what I wanted it to do. I actually have no idea if that is still the case. I haven't written much PHP in a while.

In any case, I haven't thought about this in a while because it hasn't been necessary with my typical workflow. All my state transitions are driven by a Hypermedia (REST) API. Because data only changes through API requests, it's only necessary to validate data when a request is received. Whatever, I do with the data from that request is read-only from that point until another request is made.

Mostly, my APIs are consumed by a JavaScript client in a browser. Whenever possible, I generate a form based a schema. That covers most of my client based validation needs. It sounds like what you are doing is writing a PHP client. Such a client might modify resources and would benefit from the constraint checking this project would provide. I haven't had the need to do something like in a long time, which is probably why I never came back to this.

I'm not aware of any other projects trying to approach this problem in this way. People seem to be focused on the code generation of classes from schemas approach. That is unfortunate because I think that is a terrible approach.

weitzman commented 6 years ago

Thanks for the thoughtful reply, @jdesrosiers. I'll post back here if I end up using and improving this project.