In this article, I aim to demonstrate a couple of methods for easily adding validation to REST APIs on InterSystems IRIS Data Platform. I believe a specification-first approach is an excellent idea for API development. IRIS already has features for generating an implementation stub from a specification and publishing that specification for external developers (use it with iris-web-swagger-ui for the best results). The remaining important thing not yet implemented in the platform is the request validator. Let's fix it!
Swagger is an open-source framework used to design, build, document, and consume RESTful APIs. It provides a user-friendly interface and tools to make it easy for developers to understand and interact with APIs without needing to dig through the code. Swagger uses a standard format called OpenAPI Specification to describe the structure and behavior of APIs. It's widely used for generating API documentation, testing endpoints, and even auto-generating client and server code.