Hacker News new | ask | show | jobs
by feralmoan 4862 days ago
Isn't this what http://json-schema.org aims to provide? Or am I missing something. It's a solid spec.
2 comments

Json Schema is pretty good at describing data coming through JSON. But describing (REST) APIs requires more. For example a standard way to describe API endpoints with parameters and response types, errors, related models, default/allowable values etc. This was what the OP was referring to and this is what Swagger is trying to do. The Swagger Spec is here with some more details on whats required in addition to JSON Schema to document APIs: https://github.com/wordnik/swagger-core/wiki/API-Declaration Incidentally model/data specifications in swagger spec does map closely with json schema.
Personally I'm partial to http://jschema.org/ (also see http://jschema.org/rpc.html) because it seems simpler.

My naive impression is that JSON-Schema is trying to be just like XML Schema, but in JSON. Which doesn't seem like a good thing.

But neither of these are geared towards a RESTful implementation, unless I'm missing something.