Metadata-Version: 2.4
Name: fullapi
Version: 2.1.0
Summary: Spec-driven FastAPI: generate a project from api.yaml, then enforce the spec in CI (openapi drift check).
Author: Sahil Nayak
Maintainer: Sahil Nayak
License-Expression: MIT
Project-URL: Homepage, https://github.com/sahilnyk/fullapi
Project-URL: Repository, https://github.com/sahilnyk/fullapi
Project-URL: Issues, https://github.com/sahilnyk/fullapi/issues
Project-URL: Changelog, https://github.com/sahilnyk/fullapi/blob/master/CHANGELOG.md
Keywords: fastapi,openapi,api,rest,cli,code-generator,scaffolding,boilerplate,template,sqlalchemy,pydantic,jwt,auth,postgresql,sqlite,spec-driven,api-first,contract-testing,schema-diff,ci,linter,generator,microservices,python
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Framework :: FastAPI
Classifier: Framework :: Pydantic
Classifier: Framework :: Pydantic :: 2
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Typing :: Typed
Classifier: Environment :: Console
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyYAML>=6.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pydantic; extra == "test"
Requires-Dist: pydantic-settings; extra == "test"
Dynamic: license-file

<div align="center">

# fullapi

Spec-driven FastAPI: generate a project from `api.yaml`, then enforce it in CI.

[![PyPI](https://img.shields.io/pypi/v/fullapi?color=009688)](https://pypi.org/project/fullapi/)
[![Python](https://img.shields.io/pypi/pyversions/fullapi?color=009688)](https://pypi.org/project/fullapi/)

</div>

## Why

Scaffolders help once, then leave. `fullapi` keeps the spec as the source of
truth: `gen` builds the project, `check` fails your CI when the API drifts from
the spec — a living contract, not a one-shot template.

## Quick Start

```bash
pip install fullapi
```

Write `api.yaml` (or run `fullapi init` for a starter file):

```yaml
name: shop_api
database: sqlite        # none | sqlite | postgres
auth: jwt               # optional
resources:
  - name: product
    fields:
      title: str
      price: float
      note: str?        # trailing ? = optional
    auth: true          # protect this resource's routes
```

Generate and run:

```bash
fullapi gen                       # api.yaml -> ./app
pip install -r requirements.txt
uvicorn app.main:app --reload
```

Enforce in CI:

```bash
fullapi check                     # exits non-zero on breaking changes
```

## Commands

| Command | Description |
|---------|-------------|
| `fullapi init [spec]` | Write a starter api.yaml |
| `fullapi gen [spec] [-o dir]` | Generate the project from the spec |
| `fullapi check [spec] [--app app.main:app]` | Fail on breaking drift from the spec |

## How `check` works

It reads the live app's real `app.openapi()`, derives the expected schema from
`api.yaml`, and diffs them. Removed routes/fields, type changes, and newly
required fields are **breaking** (non-zero exit); added routes and optional
fields are **safe**.

Built and maintained by [@sahilnyk](https://github.com/sahilnyk).
