Download the PHP package reinfi/openapi-models without Composer

On this page you can find all versions of the php package reinfi/openapi-models. 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-models

OpenAPI Models generated for PHP

This library does not provide any client or server implementation for your open api definition. It just generates models defined in your schemas.

This library may not be feature complete for all openapi definition. If you miss a feature, just file an issue.

Why?

There are some common open api generators like JanePHP or OpenAPI Generator but they create old PHP Syntax due to their backwards compatibility.

That is the reason why this library exists to simply generate models with new PHP syntax.

Install

Use composer to install it as development dependency.

composer require --dev reinfi/openapi-models

Usage

Default configuration file is openapi-models.php.

Your configuration file should return an array with the following settings:

Generate

To generate your files just run php vendor/bin/openapi-models generate.

If you like to store your configuration somewhere else you need to provide the file name to the command.

php vendor/bin/openapi-models generate --config spec/openapi-models.php

Validate

To validate your files, i.e. if the specification matches the generated files, you can run php vendor/bin/openapi-models validate.

Make sure you use the same configuration file as used for the generate command.

Types

This library does not support mixed type from open-api specification. Therefore, you always have to set a type in your specification.

Date or DateTime

The following schema has date/date-time properties.

The default is to generate the fields as string-type because this would not require any logic for serialization of the class.

You can change the configuration dateTimeAsObject to true and then these fields will be of type DateTimeInterface.

A serialization function is added to these classes to support native json_encode. If you do not use native json_encode you may need to provide an own implementation to fulfill open api specifications.

The default format for a date is Y-m-d, for a date-time-type is Y-m-d\TH:i:sP (RFC3339), but you can configure it.

This is just for convenience if you do not want to deal with time zones or just need different formats.


All versions of openapi-models with dependencies

PHP Build Version
Package Version
Requires php Version >= 8.2
nette/php-generator Version ^4.1
symfony/console Version ^6.0 | ^7.0
php-di/php-di Version ^7.0
marcelthole/openapi-merge Version ^2.0
michaelpetri/typed-input Version ^1.3
webmozart/glob Version ^4.6
ocramius/package-versions Version ^2.8
php-openapi/openapi Version ^2.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 reinfi/openapi-models contains the following files

Loading the files please wait ....