Documentation (README.md)

This README provides an overview of the aispec project, including its purpose, key features, and how to use it.

Purpose:

The aispec project aims to simplify the process of generating and working with OpenAPI specifications. It provides a command-line tool and a Python library for creating and manipulating OpenAPI 3.0 specifications.

Key Features:

  • Schema generation: aispec can generate OpenAPI schemas from Python code.
  • Specification generation: aispec can generate complete OpenAPI specifications from Python code or existing schemas.
  • Validation: aispec can validate OpenAPI specifications against the OpenAPI 3.0 specification.
  • Conversion: aispec can convert OpenAPI specifications between different formats, such as YAML and JSON.

Usage:

The aispec project can be used in several ways:

  • Command-line tool: The aispec command-line tool provides a simple interface for generating and validating OpenAPI specifications.
  • Python library: The aispec library can be used in Python scripts to programmatically generate and manipulate OpenAPI specifications.

Installation:

pip install aispec
          

Basic Usage (Command-Line Tool):

# Generate an OpenAPI specification from a Python class
          aispec generate -o myapi.yaml MyApiClass
          
          # Validate an OpenAPI specification
          aispec validate myapi.yaml
          
          # Convert an OpenAPI specification from YAML to JSON
          aispec convert -f yaml -t json myapi.yaml myapi.json
          

Basic Usage (Python Library):

from aispec import generate, validate
          
          # Generate an OpenAPI specification from a Python class
          openapi_spec = generate(MyApiClass)
          
          # Validate an OpenAPI specification
          validate(openapi_spec)
          

Documentation:

Contributing:

Contributions to the aispec project are welcome! Please refer to the Contribution Guidelines for more information.