Initial Release
A CLI tool that generates InterSystems IRIS CSP REST backend classes from an OpenAPI 3.1.x specification. Point it at a valid JSON spec and it produces two ready-to-import ObjectScript class files — a dispatch class that handles routing and validation, and an implementation stub where you fill in the business logic.
pip install intersystems_openapi3
Generate classes from a spec (output alongside the spec file):
intersystems_openapi3 /path/to/spec.json
Write output to a specific directory:
intersystems_openapi3 /path/to/spec.json -o /path/to/output/
Use a custom name for the generated classes:
intersystems_openapi3 /path/to/spec.json -n MyRestService
Other flags:
intersystems_openapi3 --version
intersystems_openapi3 --help
Two ObjectScript class files are generated in the output directory:
| File | Description |
|---|---|
{MyRestService}.disp.cls |
Dispatch class — handles URL routing, parameter validation, request body checks, and Accept header validation. Do not edit. |
{MyRestService}.impl.cls |
Implementation class — one stub method per operation. Add your business logic here. |
Import both files into your InterSystems IRIS instance to set up the REST API.
For each operation in the spec, the tool produces:
%String, %Integer, %Float, %Boolean)minLength, maxLength, pattern, minimum, maximum, and format-specific bounds (int32, int64)Content-Type against declared media typesAccept headers against declared response schemasoperationId, one is generated from the HTTP method and pathGiven a spec with a GET /users/{id} operation, the tool generates a dispatch method that validates the id path parameter and calls through to an implementation stub:
/// GET /users/{id}
ClassMethod GetUsersId(id As %String) As %Status
{
// Add your business logic here
Quit $$$OK
}