Using XProc, XSLT 2.0, and XSD 1.1 to validate RESTful services
Documentation of RESTful services must be accurate and detailed. As a REST service is being developed, the documentation must be kept up to date and its accuracy constantly validated. Once the REST service is released the documentation becomes a contract; clients may break if an implementation drifts from the documented rules. Also, third-party implementations must adhere to the rules in order for clients to interact with multiple implementations without issue. Ensuring conformance to the documentation is complicated, tedious, and error prone. We use our existing XML documentation pipeline to generate highly efficient validators which can check a RESTful service (and it's clients) for conformance to the documentation at runtime. We validate all aspects of the HTTP request including message content, URI templates, query parameters, headers, etc. We describe the transformation process and some of the optimizations that enable real time optimization and discuss challenges including testing the documentation pipeline and the validators themselves.