intersystems_openapi3
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.
Requirements
- Python 3.10+
- A valid OpenAPI 3.1.x spec in JSON format
Installation
pip install intersystems_openapi3
Usage
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
Output
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.
What gets generated
For each operation in the spec, the tool produces:
- Typed method signatures — parameters are annotated with ObjectScript types derived from the OpenAPI schema (
%String,%Integer,%Float,%Boolean) - Parameter validation — enforces constraints such as
minLength,maxLength,pattern,minimum,maximum, and format-specific bounds (int32,int64) - Request body handling — validates that required bodies are present and checks
Content-Typeagainst declared media types - Response media type validation — validates
Acceptheaders against declared response schemas - Auto-assigned operation IDs — if your spec omits
operationId, one is generated from the HTTP method and path
Example
Given 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
}
Release files for intersystems-openapi3 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| intersystems_openapi3-0.2.0.tar.gz | 17.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| intersystems_openapi3-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.6 kB
Release files / intersystems_openapi3-0.2.0.tar.gz
| Download URL | intersystems_openapi3-0.2.0.tar.gz |
|---|---|
| Size | 17.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cd8cd6177d88fc9bf39f8d9469031f9822d1e07a6a4b00b589db2e605184b4a7
|
|
BLAKE2b-256 checksum How to use checksums |
419f499f563884580d687d592838a9ed749d9171956fd61d20caf01101d0c3ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|
Release files / intersystems_openapi3-0.2.0-py3-none-any.whl
| Download URL | intersystems_openapi3-0.2.0-py3-none-any.whl |
|---|---|
| Size | 13.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3eabddd7b2dd8bbf6b201755225f76239f573e4443b649fa7dec56370b09f7c7
|
|
BLAKE2b-256 checksum How to use checksums |
a48565db4cc45adb7d6d414bcf9cd695a432c84acfe4d305a13c2294ea480e27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.13
|