Skip to main content

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-Type against declared media types
  • Response media type validation — validates Accept headers 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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for intersystems-openapi3 0.2.2
File Size Uploaded
intersystems_openapi3-0.2.2.tar.gz 18.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for intersystems-openapi3 0.2.2
File Interpreter ABI Platform
intersystems_openapi3-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 31.7 kB

Release files / intersystems_openapi3-0.2.2.tar.gz

Download URL intersystems_openapi3-0.2.2.tar.gz
Size 18.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9ca92aad6af5df78dadfb61a00c9325ea2da5f1a3f55439c49796aa3e8cc46ca
BLAKE2b-256 checksum
How to use checksums
7e3fd78ff142df667b26d0dd8c35b2180222bd410b8e07b7d5679f2024a62192
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.2-py3-none-any.whl

Download URL intersystems_openapi3-0.2.2-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37422c78583a6bfaa48e1ba80426afca6fe32898bc396ac71cb15accd5554b2a
BLAKE2b-256 checksum
How to use checksums
0f7e6485ecdeafafe0b5d351501cc9fc7c8b577d550a85b011a49d4dc6688d6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page