Skip to main content

Check RESTful API compliance from OpenAPI definitions and generate HTML reports

Project description

RESTful API Checker

PyPI version Python License Downloads

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


Buy Me a Coffee

Project details


Download files

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

Source Distribution

restful_checker-3.1.0.tar.gz (21.0 kB view details)

Uploaded Source

Built Distribution

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

restful_checker-3.1.0-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

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

Hashes for restful_checker-3.1.0.tar.gz
Algorithm Hash digest
SHA256 1ef8694b5ce6a523555723b85ba7d2f77702e2c4f2215df43903e87e178b820a
MD5 e691f9a4067b20e25a3bab94db0219f0
BLAKE2b-256 ba8408f43e474a5ec77222a841c049445e08d54176fa067b7a19d670d77095c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for restful_checker-3.1.0.tar.gz:

Publisher: upload-python-package.yml on JaviLianes8/restful-checker

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

File details

Details for the file restful_checker-3.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for restful_checker-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b80bbd36a3a3aaedecf924c5608a18eee1ee73c113d04fe13b29c56bd6853578
MD5 1f13f803a88aae37a01e54d203117473
BLAKE2b-256 6dce26df3213214deef9196b4169eae99130e1e05a398182c79e863855e99971

See more details on using hashes here.

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

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