Skip to main content

Convert PHP framework routes to OpenAPI 3.0 specifications

Project description

PHP Framework Routes to OpenAPI Converter

Convert PHP framework routes to OpenAPI 3.0 specifications.

Supported Frameworks

  • Laravel
  • Symfony
  • CodeIgniter

Installation

pip install -e .

Usage

CLI

python -m php_framework_routes_to_openapi_converter.cli convert routes.json laravel openapi.json

Arguments:

  1. routes.json - Input routes file
  2. laravel - Framework name (laravel, symfony, codeigniter)
  3. openapi.json - Output OpenAPI file

Python

from php_framework_routes_to_openapi_converter import convert_routes_to_openapi

routes = [
    {"uri": "/users", "methods": ["GET"], "name": "users.index"},
    {"uri": "/users/{id}", "methods": ["GET"], "name": "users.show"},
]

spec = convert_routes_to_openapi(routes, "laravel")

Example

python example.py

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

Built Distribution

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

File details

Details for the file php_framework_routes_to_openapi_converter-0.1.6.tar.gz.

File metadata

File hashes

Hashes for php_framework_routes_to_openapi_converter-0.1.6.tar.gz
Algorithm Hash digest
SHA256 e022852c2103a5765f4f936917b5d5315fd67e4b85c0e2259e98c803b4b8263e
MD5 1a4e596fbe11a0216ca0f8f647f951aa
BLAKE2b-256 2f7e5c8d4469791170818bc5853604e485f3b969a64922b1db7cb1a4030149ee

See more details on using hashes here.

File details

Details for the file php_framework_routes_to_openapi_converter-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for php_framework_routes_to_openapi_converter-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 03da3d6dd0c2ef900115ad3841ff7e323bbdb4e0f8ba891ec9d943b24c42945f
MD5 dbd0c05cc93f2ecc80036e224072c1a3
BLAKE2b-256 22a8a50855c7a018f19f2b2942661480d08b87bf7b22dfea4b3cd4289104ddc1

See more details on using hashes here.

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