3 ms·
My experience might be insignificant. I've been working with several APIs, both XML and JSON, and I'm yet to see an example where a schema have helped me writi
by ingenter 11y ago
My experience might be insignificant.
I've been working with several APIs, both XML and JSON, and I'm yet to see an example where a schema have helped me writing an automated parser. Validating the response/request? Sure.
Maybe I did not have the right tools, maybe I lacked the knowledge, but the fact is, I've been writing such parsers by hand. I'm vaguely aware that there are various C++ parser generators from XML schemas, but I could not use those because of license/compatibility issues.
I suspect it would be possible to write a schema->parser converter using meta-programming, but how many languages are capable of that without huge amounts of pain? I could probably do that in Python or LISP, but not in some other language.
And I have not seen a JSON schema being used... anywhere?
- twic 11y agoSomeone sent me a WADL file the other day: http://www.w3.org/Submission/wadl/ http://www.w3.org/Submission/wadl/ It didn't take long to find a tool which would generate a client library from it. Three caveats: Firstly, i was working in Java; WADL originated at Sun, so there are Java tools for it, but i doubt any other language has support. Secondly, i don't think it really saved me much time. Hand-coding a JSON API client isn't exactly difficult. The main advantage i can see would be in dealing with an evolving API, where the implementer of the API can continually update a WADL file which clients can use in their build process to stay up to date. Thidly, the generated code had a bug, and blew up on one of the data types returned from the API!