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.1.tar.gz.

File metadata

File hashes

Hashes for php_framework_routes_to_openapi_converter-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6cc0f9ebdecc8b11597bcfdc3cfbc2b61773566e90ebe10034faf3253b8b3a97
MD5 8389fb2e340d4a270138967ec4ac2d54
BLAKE2b-256 dad951973b4777651500e6f6e396dadbb1aea7890c113ba5f2a6b751fafaca5c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for php_framework_routes_to_openapi_converter-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa9afc80c59987f292f3c79b0eec3c293c77d127a833359e1a5d5723619f344f
MD5 21db76be41b65b17add136fc4620231d
BLAKE2b-256 4070ff681e0cb56fc7c112c03c90197fb6275d9e5c79912c755b4d9e3c1aa2ab

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