Q: What is the purpose of defining the resource with a schema?
- To have the format of the object documented in a structured manner. Because it's documented in a structured manner, we can automagically create human-readable documentation from it.
- Closely-coupling structured documentation to the code will help prevent it from getting out of date.
- We can also use the schema internally to programmatically manipulate the request or response (e.g. validate required parameters, filter response based on context)
Q: Why JSON schema?
- It is quite graybeard. JSON schema has been around for a long time, and is a well-known standard.
- We can extend JSON schema base spec to include our own attributes, and publish this extension.
- There aren't any competing standards that are better.
Q: What needs to be done to finalize our implementation for 4.4?
- Most pieces related to our schema implementation shouldn't be committed to core for 4.4.
- However, we have support for
schema
in the registration, but the implementation takes an arbitrary array/object and spits it out on OPTIONS requests.
Q: What might be done later?
- Document and publish the ways in which our schema differs from JSON schema draft 4
- Probably lots of other little things.