Check RESTful API compliance from OpenAPI definitions and generate HTML reports
Project description
RESTful API Checker
Validate RESTful best practices on your OpenAPI/Swagger specs. Generates HTML reports with actionable feedback.
This project is stable. Bug fixes will be released as issues are reported.
Installation
pip install restful-checker
Requires Python 3.8+
Usage
# Local file
restful-checker path/to/openapi.json
# Remote URL
restful-checker https://api.example.com/openapi.yaml --open
# Generate HTML + JSON
restful-checker openapi.json --output-format both --output-folder reports
Options
| Option | Description | Default |
|---|---|---|
--output-format |
html, json, or both |
html |
--output-folder |
Destination folder | ./html |
--open |
Open HTML in browser | false |
-q, --quiet |
Suppress output | false |
--version |
Show version | - |
What It Checks
URL Design
| Check | Description |
|---|---|
| Versioning | Ensures /v1/, /v2/ appears early in paths |
| Resource Naming | Detects verbs in URIs, suggests pluralization |
| Resource Nesting | Validates patterns like /users/{id}/orders |
| Path Parameters | Verifies consistent {param} usage |
HTTP Standards
| Check | Description |
|---|---|
| HTTP Methods | Validates GET, POST, PUT, DELETE usage |
| Status Codes | Checks proper use of 200, 201, 400, 404, 409, etc. |
| Content Types | Verifies application/json usage |
| HTTPS Enforcement | Ensures all servers use HTTPS |
Response Quality
| Check | Description |
|---|---|
| Response Examples | Encourages example in responses |
| Error Format | Suggests structured code and message fields |
| Response Wrapping | Warns about unnecessary envelopes |
Performance
| Check | Description |
|---|---|
| Pagination | Suggests ?page= and ?limit= for collections |
| Query Filters | Recommends filters like ?status= |
| GZIP Support | Checks Accept-Encoding |
Programmatic Usage
from restful_checker.engine.analyzer import analyze_api
result = analyze_api("path/to/openapi.json", output_dir="output")
print(f"HTML: {result['html_path']}")
print(f"JSON: {result['json_path']}")
print(f"Score: {result['json_report']['score']}")
Project Structure
restful_checker/
├── checks/ # Validation modules
├── engine/ # OpenAPI loader
├── report/ # HTML rendering
├── tools/ # CLI utilities
└── main.py # Entrypoint
Contributing
Found a bug? Open an issue.
License
MIT
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
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 restful_checker-3.1.0.tar.gz.
File metadata
- Download URL: restful_checker-3.1.0.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ef8694b5ce6a523555723b85ba7d2f77702e2c4f2215df43903e87e178b820a
|
|
| MD5 |
e691f9a4067b20e25a3bab94db0219f0
|
|
| BLAKE2b-256 |
ba8408f43e474a5ec77222a841c049445e08d54176fa067b7a19d670d77095c5
|
Provenance
The following attestation bundles were made for restful_checker-3.1.0.tar.gz:
Publisher:
upload-python-package.yml on JaviLianes8/restful-checker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
restful_checker-3.1.0.tar.gz -
Subject digest:
1ef8694b5ce6a523555723b85ba7d2f77702e2c4f2215df43903e87e178b820a - Sigstore transparency entry: 1171382644
- Sigstore integration time:
-
Permalink:
JaviLianes8/restful-checker@25ab10ddacdcaec94921119b6855369a0d6c4ec7 -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/JaviLianes8
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
upload-python-package.yml@25ab10ddacdcaec94921119b6855369a0d6c4ec7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file restful_checker-3.1.0-py3-none-any.whl.
File metadata
- Download URL: restful_checker-3.1.0-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b80bbd36a3a3aaedecf924c5608a18eee1ee73c113d04fe13b29c56bd6853578
|
|
| MD5 |
1f13f803a88aae37a01e54d203117473
|
|
| BLAKE2b-256 |
6dce26df3213214deef9196b4169eae99130e1e05a398182c79e863855e99971
|
Provenance
The following attestation bundles were made for restful_checker-3.1.0-py3-none-any.whl:
Publisher:
upload-python-package.yml on JaviLianes8/restful-checker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
restful_checker-3.1.0-py3-none-any.whl -
Subject digest:
b80bbd36a3a3aaedecf924c5608a18eee1ee73c113d04fe13b29c56bd6853578 - Sigstore transparency entry: 1171382678
- Sigstore integration time:
-
Permalink:
JaviLianes8/restful-checker@25ab10ddacdcaec94921119b6855369a0d6c4ec7 -
Branch / Tag:
refs/tags/v3.1.0 - Owner: https://github.com/JaviLianes8
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
upload-python-package.yml@25ab10ddacdcaec94921119b6855369a0d6c4ec7 -
Trigger Event:
push
-
Statement type: