Skip to main content

Workspace root for Jentic OpenAPI Tools

Project description

Jentic OpenAPI Tools

A comprehensive Python toolkit for parsing, validating, and transforming OpenAPI documents with pluggable backend architecture.

Discord Contributor Covenant License: Apache 2.0 PyPI version Python

Features

  • Pluggable Backend Architecture - Support for multiple parsing, validation, and transformation strategies via entry points
  • Type Safety - Full type hints with comprehensive type checking throughout
  • Multiple Input Formats - Accept OpenAPI documents from file URIs, JSON/YAML strings, or Python dictionaries
  • Flexible Output Types - Return results as dictionaries, strings, or custom types
  • Extensible Design - Easy integration of third-party backends through standard Python entry points
  • Path Security - Built-in defense against path traversal attacks
  • Production Ready - Comprehensive test coverage and error handling

Installation

The recommended way to install is via the meta-package, which includes all packages and backends (parser, validator, transformer, plus the Spectral, Redocly, and SpecLynx backends):

pip install jentic-openapi-tools

This also installs the jentic-openapi-tools CLI. If you only need specific functionality, you can install individual packages instead:

pip install jentic-openapi-validator                  # Core validator with default + openapi-spec backends
pip install jentic-openapi-validator-spectral          # Add Spectral backend
pip install jentic-openapi-validator-redocly           # Add Redocly backend
pip install jentic-openapi-parser                      # Parser only
pip install jentic-openapi-transformer[redocly]        # Transformer with Redocly bundler

Note that the CLI and Python API only have access to backends whose packages are installed. Installing the meta-package is the easiest way to get everything working, especially for CI pipelines and AI agents.

Prerequisites:

  • Python 3.11 or higher
  • Node.js >=20.19.0 and npm (required for Redocly and Spectral backends)

Quick Start

Parsing OpenAPI Documents

from jentic.apitools.openapi.parser.core import OpenAPIParser

# Create parser with default backend
parser = OpenAPIParser()

# Parse from file
doc = parser.parse("file:///path/to/openapi.yaml")
print(doc["info"]["title"])

# Parse from YAML/JSON string
yaml_doc = """
openapi: 3.1.0
info:
  title: My API
  version: 1.0.0
paths: {}
"""
doc = parser.parse(yaml_doc)

Validating OpenAPI Documents

from jentic.apitools.openapi.validator.core import OpenAPIValidator

# Create validator
validator = OpenAPIValidator()

# Validate from file
result = validator.validate("file:///path/to/openapi.yaml")

if result.valid:
    print("Document is valid!")
else:
    for diagnostic in result.diagnostics:
        print(f"Error: {diagnostic.message}")

Command-Line Interface

The jentic-openapi-validator package includes the jentic-openapi-tools CLI for validating OpenAPI documents directly from the terminal:

# Validate a local file
jentic-openapi-tools validate openapi.yaml

# Use a specific backend and get JSON output
jentic-openapi-tools validate -b spectral -f json openapi.yaml

# Validate a remote URL
jentic-openapi-tools validate https://petstore3.swagger.io/api/v3/openapi.json

The CLI supports text, JSON, and GitHub Actions annotation output formats, stdin input, parallel multi-backend execution, and standard exit codes for CI integration. See the jentic-openapi-validator README for the full CLI reference.

Transforming OpenAPI Documents

from jentic.apitools.openapi.transformer.bundler.core import OpenAPIBundler

# Bundle OpenAPI document with external reference resolution
bundler = OpenAPIBundler("redocly")
result = bundler.bundle("file:///path/to/openapi.yaml", return_type=dict)
print(result["info"]["title"])

Packages

This monorepo contains the following packages:

Package Description
jentic-openapi-tools Meta-package that installs all workspace packages
jentic-openapi-common Common utilities and shared functionality
jentic-openapi-datamodels OpenAPI data models and structures
jentic-openapi-parser OpenAPI document parsing with pluggable backends
jentic-openapi-traverse OpenAPI document traversal utilities
jentic-openapi-transformer OpenAPI document transformation and bundling
jentic-openapi-transformer-redocly Redocly-based transformation backend
jentic-openapi-validator OpenAPI document validation with pluggable backends
jentic-openapi-validator-redocly Redocly-based validation backend
jentic-openapi-validator-spectral Spectral-based validation backend
jentic-openapi-validator-speclynx SpecLynx ApiDOM-based validation backend

Each package has its own detailed README with comprehensive API documentation and examples.

Documentation

  • Development Guide - Setup instructions, testing, and development workflows
  • Contributing Guidelines - How to contribute to the project
  • Package READMEs - See individual package directories for detailed API documentation

Architecture

The Jentic OpenAPI Tools follow a modular architecture with a plugin-based backend system:

  • Core Packages - Provide base functionality and abstractions
  • Backend Packages - Implement specific parsing, validation, or transformation strategies
  • Entry Points - Backends register themselves via Python entry points for automatic discovery

This design allows you to:

  • Start with default backends and add advanced ones as needed
  • Implement custom backends for specific requirements
  • Use multiple backends simultaneously for comprehensive validation

Built and maintained by Jentic

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jentic_openapi_tools-1.0.0a55.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jentic_openapi_tools-1.0.0a55-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file jentic_openapi_tools-1.0.0a55.tar.gz.

File metadata

  • Download URL: jentic_openapi_tools-1.0.0a55.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jentic_openapi_tools-1.0.0a55.tar.gz
Algorithm Hash digest
SHA256 b5a1c1d291c2042d2a99fd3d113c787ea9d20e5cb13407dc09a6aa0bcdaf5827
MD5 dafaae415682cc19f6994ac8e9404513
BLAKE2b-256 e41c2d43772643a34f1f4e0b8ee01ef4fd83519cabbb41c3bfcf894438f0aba6

See more details on using hashes here.

Provenance

The following attestation bundles were made for jentic_openapi_tools-1.0.0a55.tar.gz:

Publisher: release.yml on jentic/jentic-openapi-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jentic_openapi_tools-1.0.0a55-py3-none-any.whl.

File metadata

File hashes

Hashes for jentic_openapi_tools-1.0.0a55-py3-none-any.whl
Algorithm Hash digest
SHA256 e2c2b9072969ae409810c73a2c092083758b2fa0e47cd42d61dcf0c262c7dafa
MD5 e424b22e2adc0c6f720889cfc6bd4553
BLAKE2b-256 740bc5d0a6bd3795c48a9acf5b5e82bb699883f6662e9f8136e5d376d5fcd262

See more details on using hashes here.

Provenance

The following attestation bundles were made for jentic_openapi_tools-1.0.0a55-py3-none-any.whl:

Publisher: release.yml on jentic/jentic-openapi-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page