PHP code example of reinfi / openapi-models

1. Go to this page and download the library: Download reinfi/openapi-models library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

reinfi / openapi-models example snippets


return [
    'paths' => [__DIR__ . '/spec'], # array of path to check for openapi files
    'outputPath' => __DIR__ . '/output', # output directory
    'namespace' => 'Api', # namespace for generated classes, can be empty
    'clearOutputDirectory' => true, # to remove all files in output directory, default is false
    'dateTimeAsObject' => false, # date/date-time definition will be `string` otherwise `DateTimeInterface`.
    'dateTimeFormat' => 'Y-m-d H:i:s', # format for serialize of date time fields
];

'dateFormat' => 'Y-m-d',
'dateTimeFormat' => 'Y-m-d H:i:s',