Why
Every FastAPI project ends up with the same folder layout, the same CRUD
routes, the same Pydantic models copied and renamed. fullapi generates that
from one api.yaml file instead. The part that actually matters is check:
it fails CI the moment the running app stops matching the spec, so the spec
stays true instead of turning into documentation nobody trusts.
Install
pip install fullapi
Needs Python 3.9 or newer.
Setup
Start with a spec file. Either write api.yaml by hand or run:
fullapi init
which drops a starter file you can edit. A minimal spec looks like this:
name: shop_api
database: sqlite # none | sqlite | postgres
auth: jwt # optional
resources:
- name: product
fields:
title: str
price: float
note: str? # trailing ? marks the field optional
auth: true # protect this resource's routes
Each entry under resources becomes a full CRUD resource: a database model,
request and response schemas, and the routes to create, read, update, and
delete it.
Generate and run
fullapi gen # api.yaml -> ./app
pip install -r requirements.txt
uvicorn app.main:app --reload
gen writes a working FastAPI project into ./app (or wherever you point
-o). At this point you have a normal FastAPI codebase: read it, extend it,
add your own routes alongside the generated ones.
Keep it honest
As the project grows, the code and the spec can drift apart. Someone renames
a field, drops a route, or makes something required without touching
api.yaml. check catches that:
fullapi check # exits non-zero on breaking changes
Wire it into CI and a spec/app mismatch fails the build instead of shipping quietly.
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 imports your live app and calls its real app.openapi() method, the same
schema FastAPI would serve at /openapi.json, then compares that against
what api.yaml says should exist. A route or field that disappeared, a type
that changed, or a field that became required without a matching spec
change: all of that counts as breaking and exits non-zero. New routes and
new optional fields are safe and don't fail the build.
Built and maintained by @sahilnyk.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fullapi-2.1.2.tar.gz.
File metadata
- Download URL: fullapi-2.1.2.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9cf4735beeeea423b22d571612ae13b29bbfd00bfb65bda1af1cba84b78ef88
|
|
| MD5 |
84f82753e86150ea79df1f1d25cf923b
|
|
| BLAKE2b-256 |
f11e374846e2583be10fc019791435050828e61e6ec1bf9c167c577e756c9657
|
File details
Details for the file fullapi-2.1.2-py3-none-any.whl.
File metadata
- Download URL: fullapi-2.1.2-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c06e31f02e8d1a75628cd634101f636ab2811ec45a5cdd2abb3703e10476d04b
|
|
| MD5 |
f53880a43086621aa7e8f5bdd33fcc69
|
|
| BLAKE2b-256 |
dc8fa024fd95349394decba6eaeadad0374e6ca44a67a22a5ebcfcd15c65224b
|