Download the PHP package methorz/openapi-generator without Composer

On this page you can find all versions of the php package methorz/openapi-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package openapi-generator

MethorZ OpenAPI Generator

Automatic OpenAPI 3.0 specification generator from routes and DTOs

CI codecov PHPStan PHP Version

Automatically generates OpenAPI specifications by analyzing your application's routes and Data Transfer Objects (DTOs). Perfect for Mezzio, Laminas, and any PSR-15 application.


โœจ Features


๐Ÿ“‹ Requirements

This package requires PHP 8.2+ and uses the following runtime dependencies:

Package Purpose Framework Required?
psr/container PSR-11 Container Interface โŒ No
symfony/console CLI command handling โŒ No (standalone utility)
symfony/yaml YAML file parsing/writing โŒ No (standalone utility)

Note: The Symfony packages used are standalone utility libraries, not framework components. They work independently without the Symfony framework and are used by many non-Symfony projects (Composer, PHPStan, PHPUnit, etc.).


๐Ÿ“ฆ Installation


๐Ÿš€ Quick Start

1. Register the Command

Add to your application's command configuration:

2. Generate Specification

This will create:


๐Ÿ“– Usage

Basic Configuration

Example Handler

The generator automatically analyzes your handlers:

Example Request DTO

Generated Schema:


๐Ÿ“‹ Supported Validation Attributes

The generator extracts constraints from Symfony Validator attributes:

Attribute OpenAPI Property
@Assert\NotBlank required: true
@Assert\Length(min, max) minLength, maxLength
@Assert\Range(min, max) minimum, maximum
@Assert\Email format: email
@Assert\Url format: uri
@Assert\Uuid format: uuid

๐Ÿš€ Advanced Features

Enum Support

Generates enum schemas from PHP 8.1+ backed enums:

Generated Schema:

Nested DTOs

Automatically generates schemas for nested DTO objects:

Generated Schema:

Typed Collections

Supports typed arrays using PHPDoc annotations:

Generated Schema:

Union Types

Generates oneOf schemas for union types:

Generated Schema:


๐ŸŽฏ Features

Route Detection

Scans your application's route configuration:

Automatic Operation Generation

Creates OpenAPI operations with:

Path Parameters

Automatically detects and types path parameters:


๐Ÿ“‚ Generated Output

OpenAPI Structure


๐Ÿ”ง Configuration

Full Configuration Example


๐Ÿ“Š Integration with Swagger UI

View your generated OpenAPI specification:

Or use online tools:


๐Ÿงช Testing


๐Ÿค Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for new features
  4. Ensure all quality checks pass (composer quality)
  5. Submit a pull request

๐Ÿ“„ License

MIT License. See LICENSE for details.


๐Ÿ”— Related Packages

This package is part of the MethorZ HTTP middleware ecosystem:

Package Description
methorz/http-dto Automatic HTTP โ†” DTO conversion with validation
methorz/http-problem-details RFC 7807 error handling middleware
methorz/http-cache-middleware HTTP caching with ETag support
methorz/http-request-logger Structured logging with request tracking
methorz/openapi-generator Automatic OpenAPI spec generation (this package)

These packages work together seamlessly in PSR-15 applications.


๐Ÿ™ Acknowledgments

Built with:


๐Ÿ“ž Support


๐Ÿ”— Links


Made with โค๏ธ by Thorsten Merz


All versions of openapi-generator with dependencies

PHP Build Version
Package Version
Requires php Version ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
psr/container Version ^1.1 || ^2.0
symfony/console Version ^6.0 || ^7.0
symfony/yaml Version ^6.0 || ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package methorz/openapi-generator contains the following files

Loading the files please wait ...